diff options
author | Raimonds Simanovskis <raimonds.simanovskis@gmail.com> | 2010-12-23 21:55:42 +0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-23 23:22:00 +0800 |
commit | 2b795050de72c6d68aba7513510f74ddc8959ee7 (patch) | |
tree | ed637b285fbf49f5c10a67a735d43d398f6cce15 /activerecord | |
parent | d9c8c47e3db89ca75de6ae9a8497659378ef0c1d (diff) | |
download | rails-2b795050de72c6d68aba7513510f74ddc8959ee7.tar.gz rails-2b795050de72c6d68aba7513510f74ddc8959ee7.tar.bz2 rails-2b795050de72c6d68aba7513510f74ddc8959ee7.zip |
fixed retrieval of primary key value in Ralation#insert method
previously primary key value was always assigned nil which caused Oracle enhanced adapter failing tests
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 7ecba1c43a..d4c5c85594 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -31,7 +31,7 @@ module ActiveRecord im = arel.compile_insert values im.into @table primary_key_name = @klass.primary_key - primary_key_value = Hash === values ? values[primary_key_name] : nil + primary_key_value = primary_key_name && Hash === values ? values[primary_key] : nil @klass.connection.insert( im.to_sql, |