circleci
19265 of 21230 relevant lines covered (90.74%)
566.79 hits per line
1 |
class Status::ReportPolicy < ApplicationPolicy |
3✔ |
2 |
def initialize(user, record) |
3✔ |
3 |
super(user, record, user_optional: true) |
82✔ |
4 |
end
|
|
5 |
|
|
6 |
def create? |
3✔ |
7 |
return false if user.blank? |
82✔ |
8 |
record.projects && record.projects.all? { |project| user.can_modify?(project) } |
164✔ |
9 |
end
|
|
10 |
|
|
11 |
def update? |
3✔ |
12 |
create? |
66✔ |
13 |
end
|
|
14 |
|
|
15 |
def destroy? |
3✔ |
16 |
create? |
8✔ |
17 |
end
|
|
18 |
|
|
19 |
def index? |
3✔ |
20 |
true
|
× |
21 |
end
|
|
22 |
|
|
23 |
def show? |
3✔ |
24 |
true
|
× |
25 |
end
|
|
26 |
end
|