push
travis-ci-com
1982 of 2461 relevant lines covered (80.54%)
25.1 hits per line
1 |
class ItemPolicy < ApplicationPolicy |
2✔ |
2 |
def index? |
2✔ |
3 |
true
|
× |
4 |
end
|
|
5 |
|
|
6 |
def show? |
2✔ |
7 |
true
|
2✔ |
8 |
end
|
|
9 |
|
|
10 |
def create? |
2✔ |
11 |
true if user.try(:has_role?, 'Librarian') |
10✔ |
12 |
end
|
|
13 |
|
|
14 |
def edit? |
2✔ |
15 |
true if user.try(:has_role?, 'Librarian') |
× |
16 |
end
|
|
17 |
|
|
18 |
def update? |
2✔ |
19 |
true if user.try(:has_role?, 'Librarian') |
× |
20 |
end
|
|
21 |
|
|
22 |
def destroy? |
2✔ |
23 |
if user.try(:has_role?, 'Librarian') |
4✔ |
24 |
record.removable? |
4✔ |
25 |
end
|
|
26 |
end
|
|
27 |
end
|