Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Tag_Counts not acting as advertised #185

Closed
seanahrens opened this Issue · 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

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
@guyisra

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.