From 6a3626b978ff721728af5aaca5f9c1d74cd90ff7 Mon Sep 17 00:00:00 2001 From: stopdropandrew Date: Mon, 15 Sep 2014 17:03:10 -0700 Subject: Backwards compat for activerecord-deprecated_finders Maintain compatibility for: * ActiveRecord::Base#find(:all) * ActiveRecord::Base#find(:first) * ActiveRecord::Base#find(:last) --- activerecord/lib/active_record/core.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 83859e474a..61f1a9aa27 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -124,6 +124,8 @@ module ActiveRecord def find(*ids) # We don't have cache keys for this stuff yet return super unless ids.length == 1 + # Allow symbols to super to maintain compatibility for deprecated finders until Rails 5 + return super if ids.first.kind_of?(Symbol) return super if block_given? || primary_key.nil? || default_scopes.any? || -- cgit v1.2.3