hide forum votes if the request is not pending

This commit is contained in:
Albert Yi
2018-05-11 17:05:26 -07:00
parent b31166a5e2
commit 9310b39fda
7 changed files with 54 additions and 6 deletions

View File

@@ -134,6 +134,10 @@ class ForumPost < ApplicationRecord
end
end
def tag_change_request
bulk_update_request || tag_alias || tag_implication
end
def votable?
# shortcut to eliminate posts that are probably not tag change requests
body =~ /->/ && (bulk_update_request.present? || tag_alias.present? || tag_implication.present?) && created_at >= TagRelationship::EXPIRY.days.ago