Problem with acts_as_taggable_on

tag_counts doesn’t seem to be working correctly.

Ruby 1.9.2, Rails 2.3.5

From script/console

ruby-1.9.2-p0 > Corp.tag_counts
=> [#<Tag id: 1, name: “law”>, #<Tag id: 6, name: “vc”>]

According to the documentation, I would expect to see a hash of tag-
name vs. counts entries.


On Jan 6, 9:57pm, jmcguckin [email protected] wrote:

name vs. counts entries.
Actually i think it looks like what you are supposed to get back are
tag objects, but with an extra attribute (a count of the number of
occurences). The default inspects method for AR objects doesn’t print
extra attributes, but they’re their all the same (call .attributes to
see all that attributes an active record object has)


You are correct!

ruby-1.9.2-p0 > Corp.tag_counts[0].attributes
=> {“count”=>“19”, “id”=>1, “name”=>“law”}



On Jan 6, 3:27pm, Frederick C. [email protected]