pundit: convert post versions to pundit.

This commit is contained in:
evazion
2020-03-19 20:35:33 -05:00
parent ba0a5dda8a
commit ffae64f127
5 changed files with 43 additions and 32 deletions

View File

@@ -233,14 +233,6 @@ class PostVersion < ApplicationRecord
post.save!
end
def can_undo?(user)
version > 1 && post&.visible? && user.is_member?
end
def can_revert_to?(user)
post&.visible? && user.is_member?
end
def api_attributes
super + [:obsolete_added_tags, :obsolete_removed_tags, :unchanged_tags]
end