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