I have two models with an habtm relationship:
Foo has_and_belongs_to_many Bars (and vice-versa, obviously).
Let''s say Bar has_many Bazs (how the heck do you pluralize Baz?).
It would be nice to be able to say that Foo has_many Bazs through =>
Bar, but this does not seem to work.
Am I right, or should it be possible to do this?
The best I have been able to do is this:
bazs = []
my_foo.bars.each do |b|
bazs += b.bazs
end
bazs.uniq!
That''s not TOO messy, but not as clean as foo.bazs.
If I am right about foo.bazs not being possible, is there a better/
cleaner workaround than the one I am using?
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---