diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-01-02 20:33:18 +0000 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-03 16:24:31 -0800 |
commit | 3103296a61709e808aa89c3d37cf22bcdbc5a675 (patch) | |
tree | 2f8b031165014329b4c77a785c17f06c056bf850 /activerecord/lib/active_record/relation | |
parent | d6289aadce1b8fa93e799500e52f92ce8d159d6f (diff) | |
download | rails-3103296a61709e808aa89c3d37cf22bcdbc5a675.tar.gz rails-3103296a61709e808aa89c3d37cf22bcdbc5a675.tar.bz2 rails-3103296a61709e808aa89c3d37cf22bcdbc5a675.zip |
Let AssociationCollection#find use #scoped to do its finding. Note that I am removing test_polymorphic_has_many_going_through_join_model_with_disabled_include, since this specifies different behaviour for an association than for a regular scope. It seems reasonable to expect scopes and association proxies to behave in roughly the same way rather than having subtle differences.
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/spawn_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb index e1f7fa2949..a8fb1bccf4 100644 --- a/activerecord/lib/active_record/relation/spawn_methods.rb +++ b/activerecord/lib/active_record/relation/spawn_methods.rb @@ -102,7 +102,7 @@ module ActiveRecord options.assert_valid_keys(VALID_FIND_OPTIONS) finders = options.dup - finders.delete_if { |key, value| value.nil? } + finders.delete_if { |key, value| value.nil? && key != :limit } ([:joins, :select, :group, :order, :having, :limit, :offset, :from, :lock, :readonly] & finders.keys).each do |finder| relation = relation.send(finder, finders[finder]) |