Displaying 1 result from an estimated 1 matches for "findcontains".
2006 Feb 12
2
ActiveRecord Many-To-Many relationship question
...lo,
I''ve got two models: Photo and Tag, which have an M to N relationship.
When I run Photo.find and specify "tag = foo" as a condition, I get a list
of all photos associated with tag foo. So far so good.
But each the tags member of each of the photo objects returned by
Photo.findcontains only the tag "foo" even if the photo in question
also has the tags
"bar" and "baz". Is there some way to get ActiveRecord to return "foo",
"bar", and "baz" in the tags list?
I understand why I''m seeing this behavior (the underly...