Skip to content

Commit

Permalink
Fix to content tag cloud issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cykod committed Aug 18, 2010
1 parent 981a55b commit 22c5051
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/content_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def self.get_tag_cloud(class_name,sizes = [])
:select => 'content_tags.name as name, content_tags.id, COUNT(content_tag_tags.id) as cnt',
:joins => :content_tag_tags,:order => 'content_tags.name',:group => 'content_tags.id')
content_tags.collect do |tg|
size = sizes.size < tg.cnt.to_i ? sizes[-1] : sizes[tg.cnt-1]
size = sizes.size < tg.cnt.to_i ? sizes[-1] : sizes[tg.cnt.to_i-1]
{ :name => tg.name, :count => tg.cnt, :id => tg.id, :size => size }
end
end
Expand Down

0 comments on commit 22c5051

Please sign in to comment.