aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-08-04 08:44:35 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-08-04 08:44:53 -0700
commitcff7f53fbcce14f190cc2d993467ba77fe8fa03d (patch)
treeb459fffdd51f70b52807fa736ed100086414d15e /activerecord/lib
parent7e2399a42feb47407ad0cb0688815812f68804de (diff)
downloadrails-cff7f53fbcce14f190cc2d993467ba77fe8fa03d.tar.gz
rails-cff7f53fbcce14f190cc2d993467ba77fe8fa03d.tar.bz2
rails-cff7f53fbcce14f190cc2d993467ba77fe8fa03d.zip
do not pass AR objects to ARel
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb
index bad9af250d..b34c11973b 100644
--- a/activerecord/lib/active_record/relation/finder_methods.rb
+++ b/activerecord/lib/active_record/relation/finder_methods.rb
@@ -286,6 +286,8 @@ module ActiveRecord
end
def find_one(id)
+ id = id.id if ActiveRecord::Base === id
+
record = where(primary_key.eq(id)).first
unless record