From: Robert Klemme Date: 2008-08-06T04:33:32+09:00 Subject: Re: Still missing the boat on class/instance methods On 05.08.2008 12:30, David A. Black wrote: > On Tue, 5 Aug 2008, Robert Klemme wrote: >> Also you can probably simplify this to >> >> def has_item? form_item_id >> ec_line_items.find {|ec_line_item| ec_line_item.form_item_id == form_item_id} >> end > > ActiveRecord overrides #find for its association collections, so you'd > have to use #detect, or a :conditions clause on the find. I knew there would be some trouble (hence the "probably" above). Thank you for pointing it out. Cheers robert