pundit: convert forum post votes to pundit.

This commit is contained in:
evazion
2020-03-18 02:43:45 -05:00
parent be59e85d25
commit cc2b4abd09
8 changed files with 54 additions and 27 deletions

View File

@@ -81,10 +81,6 @@ class ForumPost < ApplicationRecord
end
end
def votable?
bulk_update_request.present? && bulk_update_request.is_pending?
end
def voted?(user, score)
votes.where(creator_id: user.id, score: score).exists?
end