Mark Y g wrote: > Hey guys, > > I spent last night trawling through the rails API looking for some > sort of @object1.associated_with?(@object2) and couldn't find > anything, but it seems so fundamental.. Does anything like this > exist?
Sure. Assuming you have your associations set up properly (for example, User has_many :posts), you could do @post.user == @user or @user.posts.include? @post. > > if not, i might build a simple plugin/gem to mimic this behaviour. > > Mark Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/.
-- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

