diff options
| author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-03-13 11:49:00 -0700 |
|---|---|---|
| committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-03-13 11:49:00 -0700 |
| commit | 23ffd03ede9b27a6cbc3154aa99c247b718ccdbc (patch) | |
| tree | 019381cef90f2dae6e4926ff4dbf4574a8d84e33 /activerecord/lib | |
| parent | 7658dc37a40077444fee1eafcf4a59fae1b441a5 (diff) | |
| download | rails-23ffd03ede9b27a6cbc3154aa99c247b718ccdbc.tar.gz rails-23ffd03ede9b27a6cbc3154aa99c247b718ccdbc.tar.bz2 rails-23ffd03ede9b27a6cbc3154aa99c247b718ccdbc.zip | |
add the deprecation to adequate record too
Diffstat (limited to 'activerecord/lib')
| -rw-r--r-- | activerecord/lib/active_record/core.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 7d81934526..73ca468d80 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -128,7 +128,11 @@ module ActiveRecord ids.first.kind_of?(Array) id = ids.first - id = id.id if ActiveRecord::Base === id + if ActiveRecord::Base === id + id = id.id + ActiveSupport::Deprecation.warn "You are passing an instance of ActiveRecord::Base to `find`." \ + "Please pass the id of the object by calling `.id`" + end key = primary_key s = find_by_statement_cache[key] || find_by_statement_cache.synchronize { |
