Paul, if @client.line_items.exists?
Anthony Crumley http://commonthread.com On Mon, Apr 12, 2010 at 8:30 PM, Paul Jonathan Thompson <[email protected]>wrote: > What is the new way to check if a parent has child items? In rails > 1.2.6 I did this: > > if @client.has_line_items? > > Client being the parent and line_items the children. > > Now that I have upgraded to rails 2.0.1 (on my way to current :-) ) I > am getting this message: > > undefined method `has_line_items?' for #<Client:0x7f3b093b01a0> > > How should I format the query now? > > Regards, > > Paul Thompson > > -- > 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]<rubyonrails-talk%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- 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.

