diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-03 15:33:59 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-03 15:33:59 -0800 |
commit | d21f38aaa204ee8df81bd34a6dad3d6de8ad63d9 (patch) | |
tree | e4370d02485ee62b99bb0eb47e7f32360ef929a1 /activerecord/lib/active_record/relation | |
parent | 399730bdd2f133e9fecac501e2f2333be5f29aa2 (diff) | |
download | rails-d21f38aaa204ee8df81bd34a6dad3d6de8ad63d9.tar.gz rails-d21f38aaa204ee8df81bd34a6dad3d6de8ad63d9.tar.bz2 rails-d21f38aaa204ee8df81bd34a6dad3d6de8ad63d9.zip |
use the columns hash for primary key lookup
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 1da7411589..51ba17c9be 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -290,7 +290,7 @@ module ActiveRecord def find_one(id) id = id.id if ActiveRecord::Base === id - column = primary_key.column + column = columns_hash[primary_key.name.to_s] substitute = connection.substitute_for(column, @bind_values) relation = where(primary_key.eq(substitute)) |