diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-31 11:29:52 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-31 11:34:15 -0800 |
commit | c4469e6c39f68eee97d6cc21412b685eaeb59dce (patch) | |
tree | b3f2df045377e58d92e22973ef6596be54f068f4 /activerecord/lib/active_record/relation | |
parent | 75de1ce131cd39f68dbe6b68eecf2617a720a8e4 (diff) | |
download | rails-c4469e6c39f68eee97d6cc21412b685eaeb59dce.tar.gz rails-c4469e6c39f68eee97d6cc21412b685eaeb59dce.tar.bz2 rails-c4469e6c39f68eee97d6cc21412b685eaeb59dce.zip |
Revert "Merge pull request #4746 from jenslukowski/issue4718"
This reverts commit 5cad7a0dba652f3e942e58087bc88ba5c5390edc, reversing
changes made to bb842e8d2111e50b21a14b8bd6d89371a4b9cd68.
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index b54a167dc3..f1ac421a50 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -318,8 +318,7 @@ module ActiveRecord def find_one(id) id = id.id if ActiveRecord::Base === id - if IdentityMap.enabled? && - (where_values.blank? || contains_only_subclass_constraint?(where_values)) && + if IdentityMap.enabled? && where_values.blank? && limit_value.blank? && order_values.blank? && includes_values.blank? && preload_values.blank? && readonly_value.nil? && joins_values.blank? && @@ -395,11 +394,5 @@ module ActiveRecord def using_limitable_reflections?(reflections) reflections.none? { |r| r.collection? } end - - def contains_only_subclass_constraint?(where_values) - where_values.length == 1 && - !where_values[0].left.nil? && where_values[0].left.relation.name == table_name && - !where_values[0].right.nil? && where_values[0].right.length == 1 && where_values[0].right[0] == @klass.name - end end end |