Jeff wrote:
I'm trying to find the best way to handle this task, and I'm not
having much luck. I think I lack knowledge of the terminology to
research this. I have these models:
Account, which has many Pages
Page, has many Items
Item, has many Tags (through a join model: ItemTag)
Tag,
What I have now is similar, but using has_many :through instead of
habtm. What I'm looking for is something functionally equivalent to:
account = Account.find(:first)
account.tags # returns all tags across all items, on all pages
Note that the tags are actually associated with items, which are
Jeff wrote:
What I have now is similar, but using has_many :through instead of
habtm. What I'm looking for is something functionally equivalent to:
account = Account.find(:first)
account.tags # returns all tags across all items, on all pages
Note that the tags are actually associated
def tags
pages.map(:items).map(:tags)
end
If you must.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To
4 matches
Mail list logo