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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user