diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2017-08-02 09:52:14 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-02 09:52:14 -0500 |
commit | c6974229d018b73f70e38ca8c8862473870d0274 (patch) | |
tree | 51a95d540eeece7a77c44166caa1ebf120027eba /activerecord/lib/active_record/core.rb | |
parent | 4c3c4182a7bde6a736c0b489276da9f77fc430f2 (diff) | |
parent | 869cb93de12141425b73f43e93f6e3730147b0ed (diff) | |
download | rails-c6974229d018b73f70e38ca8c8862473870d0274.tar.gz rails-c6974229d018b73f70e38ca8c8862473870d0274.tar.bz2 rails-c6974229d018b73f70e38ca8c8862473870d0274.zip |
Merge branch 'master' into active-storage-import
Diffstat (limited to 'activerecord/lib/active_record/core.rb')
-rw-r--r-- | activerecord/lib/active_record/core.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 8b97dbe5bf..cdd3b5114a 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -168,8 +168,7 @@ module ActiveRecord id = ids.first - return super if id.kind_of?(Array) || - id.is_a?(ActiveRecord::Base) + return super if StatementCache.unsupported_value?(id) key = primary_key @@ -194,7 +193,7 @@ module ActiveRecord hash = args.first return super if !(Hash === hash) || hash.values.any? { |v| - v.nil? || Array === v || Hash === v || Relation === v || Base === v + StatementCache.unsupported_value?(v) } # We can't cache Post.find_by(author: david) ...yet |