Merge branch 'enabled-check'

This commit is contained in:
Joe Buhlig 2016-03-24 07:18:31 -05:00
commit 1be548a0d3
1 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ after_initialize do
attributes :can_vote, :single_vote, :vote_count, :has_votes, :user_voted, :who_voted
def can_vote
object.topic.category.respond_to?(:custom_fields) ? !!object.topic.category.custom_fields["enable_topic_voting"] : false
object.topic.can_vote
end
def single_vote
@ -128,7 +128,7 @@ after_initialize do
class ::Topic
def can_vote
self.category.respond_to?(:custom_fields) ? !!self.category.custom_fields["enable_topic_voting"] : false
self.category.respond_to?(:custom_fields) and SiteSetting.feature_voting_enabled and self.category.custom_fields["enable_topic_voting"].eql?("true")
end
def vote_count