pundit: convert post votes to pundit.

Side effects:

* The data-current-user-is-voter <body> attribute has been removed.
* {{upvote:self}} no longer works. {{upvote:<name>}} should be used instead.
This commit is contained in:
evazion
2020-03-19 22:55:28 -05:00
parent 33d81d0d1b
commit 415d9591c5
9 changed files with 46 additions and 42 deletions

View File

@@ -17,8 +17,7 @@ class User < ApplicationRecord
# Used for `before_action :<role>_only`. Must have a corresponding `is_<role>?` method.
Roles = Levels.constants.map(&:downcase) + [
:banned,
:approver,
:voter
:approver
]
# candidates for removal:
@@ -354,10 +353,6 @@ class User < ApplicationRecord
level >= Levels::ADMIN
end
def is_voter?
is_gold?
end
def is_approver?
can_approve_posts?
end