Acts_as_taggable scoped in another class/table?


#1

I’m hoping someone more familiar with DHH’s acts_as_taggable plugin
can help me out here…

Tags being all the rage, and the subject of a good recipe in the
forthcoming Pragmatic Rails Recipes book, I decided to give them a
try. However, from what I can tell, they’re kind of application-wide
by design. I know the social thing is hot, but I need my tags to be
specific to another table - specific to each user, rather than shared
between all.

For example, say my User model has all my accounts, and my Categories
model has:

acts_as_list :scope => :user

which works like I want, I can sort my Categories within Users. But
then, wanting to do the same thing with tags applied to Users, I try:

acts_as_taggable :scope => :website

But this doesn’t seem to work. I can do something like this to find
Tags applied to my Category:

Tag.find_by_name(tag_name).tagged

Yet how do I ask for all Tags used by a single User?


#2

On Feb 13, 2006, at 3:41 PM, Raymond B. wrote:

Yet how do I ask for all Tags used by a single User?

I was just wondering the same thing, glad this got brought up. I’d
imagine that the taggings or tags db table would have to be altered
to hold the attribution, and the code would have to be changed to
record it. What’s the practice for modifying plugins like this?

Toby