Merge pull request #519 from AyuntamientoMadrid/fix-tagcloud-488

Fix tagcloud
This commit is contained in:
Juanjo Bazán
2015-09-17 17:24:39 +02:00
20 changed files with 219 additions and 23 deletions

View File

@@ -127,6 +127,14 @@ class Debate < ActiveRecord::Base
cached_votes_up/flags_count.to_f < 5
end
def after_hide
self.tags.each{ |t| t.decrement_custom_counter_for('Debate') }
end
def after_restore
self.tags.each{ |t| t.increment_custom_counter_for('Debate') }
end
def self.title_max_length
@@title_max_length ||= self.columns.find { |c| c.name == 'title' }.limit || 80
end