diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-04 08:44:35 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-04 08:44:53 -0700 |
commit | cff7f53fbcce14f190cc2d993467ba77fe8fa03d (patch) | |
tree | b459fffdd51f70b52807fa736ed100086414d15e /activerecord | |
parent | 7e2399a42feb47407ad0cb0688815812f68804de (diff) | |
download | rails-cff7f53fbcce14f190cc2d993467ba77fe8fa03d.tar.gz rails-cff7f53fbcce14f190cc2d993467ba77fe8fa03d.tar.bz2 rails-cff7f53fbcce14f190cc2d993467ba77fe8fa03d.zip |
do not pass AR objects to ARel
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 2 |
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 |