On Aug 20, 8:01 am, CoolAJ86 <[email protected]> wrote:
> This is what I'm trying to do:
>
> @contacts = Contact.find(:all, :conditions => [["jobs.name LIKE ?",
> 'Teacher%'], {:group_id => current_contact.group}], :include =>
> [:jobs, :photos])
>
> Obviously it's not working. Is this my only option?
> @contacts = Contact.find(:all, :conditions => ['jobs.name LIKE ? AND
> group_id = ?', 'Teacher%', current_contact.group], :include =>
> [:jobs, :photos])

In general that is about it. In this particular case it looks like you
could do

current_contact.group.contacts.find :all, :conditions => [["jobs.name
LIKE ?", 'Teacher%'], ...

assuming that group has_many contacts

Fred
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to