Permalink
Browse files

add the deprecation to adequate record too

  • Loading branch information...
1 parent 7658dc3 commit 23ffd03ede9b27a6cbc3154aa99c247b718ccdbc @tenderlove tenderlove committed Mar 13, 2014
Showing with 5 additions and 1 deletion.
  1. +5 −1 activerecord/lib/active_record/core.rb
@@ -128,7 +128,11 @@ def find(*ids)
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 {

0 comments on commit 23ffd03

Please sign in to comment.