This project is archived and is in readonly mode.
Added :select options to has_one and belongs_to
Reported by José Valim | May 23rd, 2008 @ 10:32 AM
Now, since we preload associations, :select options will work great in has_one and in belongs_to, so I've added this option.
But a bug is also fixed in this patch:
Currently belongs_to accepts the :order key, but it wasn't used when we were going to find the association, i.e. setting it wouldn't change a thing (active_record/associations/belongs_to_association.rb, line 43):
:conditions => conditions,
:include => @reflection.options[:include],
:readonly => @reflection.options[:readonly]
Since it doesn't make sense having a order in belongs_to (this behavior wasn't even in tests), I took the key out, basically removing it from the assert valid keys args and updating the documentation.
Comments and changes to this ticket
- State changed from new to resolved
(from [8d0b4fa39fab6e5d1e3382b4b137cc47e559b0be]) Added :select option to has_one and belongs_to, remove unused :order option on belongs_to.
Signed-off-by: Michael Koziarski
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Tickets have moved to Github
The new ticket tracker is available at https://github.com/rails/rails/issues