Remove ancient votes code that is no longer used.

This commit is contained in:
Guo Xiang Tan
2018-02-28 14:37:22 +08:00
parent 764b6c005c
commit e7a7356986
3 changed files with 1 additions and 39 deletions
+1 -13
View File
@@ -46,10 +46,7 @@ module PostGuardian
not(post.trashed?) &&
# don't like your own stuff
not(action_key == :like && is_my_own?(post)) &&
# no voting more than once on single vote topics
not(action_key == :vote && opts[:voted_in_topic] && post.topic.has_meta_data_boolean?(:single_vote))
not(action_key == :like && is_my_own?(post))
end
!!result
@@ -75,11 +72,6 @@ module PostGuardian
return can_see_flags?(topic) if PostActionType.is_flag?(type_symbol)
if type_symbol == :vote
# We can see votes if the topic allows for public voting
return false if topic.has_meta_data_boolean?(:private_poll)
end
true
end
@@ -207,10 +199,6 @@ module PostGuardian
can_see_post?(post)
end
def can_vote?(post, opts = {})
post_can_act?(post, :vote, opts: opts)
end
def can_change_post_owner?
is_admin?
end