Thank you.  But is there a way to navigate that relationship, not by a
find?

> I think the design is fine, actually.  If I understand correctly, your
> transactions table has columns police_id and product_id (and others).
> 
> If so, you can find a transaction this way:
> 
> Transaction.find_by_police_and_product(police, product)
> 
> This will return the first one that matches.  You can also add further
> conditions, ordering, etc. as with any other find.
> 
> Jeff
> 
> www.purpleworkshops.com
-- 
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 rubyonrails-talk@googlegroups.com
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