Forum: Rails-core (closed, excessive spam) Hash Conditions for belongs_to assocations : A little sprinkling of sugar

Posted by Nik Wakelin (Guest)
on 2008-06-22 13:38
(Received via mailing list)
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-...

(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
This topic is locked and can not be replied to.