Nik Wakelin
2008-Jun-22  11:37 UTC
Hash Conditions for belongs_to assocations : A little sprinkling of sugar
Hi Everyone,
I''ve just uploaded a patch that allows you to do:
 Person.find(:all, :conditions => { :university => victoria_wellington })
i.e leave off the "_id" for belongs_to associations (specify the
association name rather than the foreign key).
Looking for comments, suggestions and hopefully +1''s. :)
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/467-hash-conditions-belongs_to-sugar
(The obvious thing to do is expand that syntax out to cover all
assocation types, but I thought I''d start small).
Cheers!
Nik
-- 
Nik Wakelin
Code to Customer
nik@codetocustomer.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---