diff --git a/lib/acts_as_taggable_on/tags_helper.rb b/lib/acts_as_taggable_on/tags_helper.rb index bde0baadf..bcbeb19ef 100644 --- a/lib/acts_as_taggable_on/tags_helper.rb +++ b/lib/acts_as_taggable_on/tags_helper.rb @@ -4,10 +4,10 @@ module TagsHelper def tag_cloud(tags, classes) return [] if tags.empty? - max_count = tags.sort_by(&:count).last.count.to_f + max_count = tags.sort_by(&:taggings_count).last.taggings_count.to_f tags.each do |tag| - index = ((tag.count / max_count) * (classes.size - 1)) + index = ((tag.taggings_count / max_count) * (classes.size - 1)) yield tag, classes[index.nan? ? 0 : index.round] end end