Saturday, September 4, 2010

[Rails] Re: Using ActiveRecord Find with associations

> > Probably not explaining this clearly enough (I blame the
distillery
> > masters at Lagavulin), but:
>
> Wish I was there! Which of their Beer is available in the US?
>
Lol, Lagavulin is a famous WHISKY destillery
>
>
> By the way, my_order.find_by_line_item fails with "no such method", not
> just by returning [].
>
ActiveRecord knows that your line_item belongs to an order.
So it's as easy as:
my_line_item.Order

--
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 unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate