Skip to content

Tag_Counts not acting as advertised #185

Closed
seanahrens opened this Issue Aug 29, 2011 · 2 comments

3 participants

@seanahrens

When I call .tag_counts, I get a list of tags without any counts:

u = User.new
u.skill_list = "nunchucks, dogg fighting"
u.save
User.skill_counts
=> [#, #]

But the readme says this should be the expected output:

@frankie = User.create(:name => "Frankie", :skill_list => "joking, flying, eating")
User.skill_counts # => [,...]

@artemk
Collaborator
artemk commented Dec 18, 2011

count is returning. It is not shown in Inspect, because count is taken from sql. Try to run User.skill_counts.first.count and you will get what you are expecting.

@artemk artemk closed this Dec 18, 2011
@guyisra
guyisra commented Oct 23, 2012

How would I get the count for each tag? Must I do something like User.tag_counts.map{|x| [x.name, x.count]} ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.