push
coveralls-ruby
37 of 37 new or added lines in 7 files covered. (100.0%)
4811 of 10313 relevant lines covered (46.65%)
8.75 hits per line
1 |
# frozen_string_literal: true
|
|
2 |
|
|
3 |
# Check the access policies for API::CreditsController
|
|
4 |
class CreditPolicy < ApplicationPolicy |
1✔ |
5 |
def index? |
1✔ |
6 |
user.admin? |
4✔ |
7 |
end
|
|
8 |
|
|
9 |
def create? |
1✔ |
10 |
index? |
3✔ |
11 |
end
|
|
12 |
|
|
13 |
def update? |
1✔ |
14 |
index? |
1✔ |
15 |
end
|
|
16 |
|
|
17 |
def destroy? |
1✔ |
18 |
index? |
× |
19 |
end
|
|
20 |
|
|
21 |
def user_resource? |
1✔ |
22 |
record.id == user.id |
3✔ |
23 |
end
|
|
24 |
end
|