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):
def find_target
@reflection.klass.find(
@owner[@reflection.primary_key_name],
:conditions => conditions,
:include => @reflection.options[:include],
:readonly => @reflection.options[:readonly]
)
end
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.
Test included.