aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-01-25 14:42:08 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-01-25 14:42:22 -0800
commit522c0fdb555d54ca68d1acfd1bd8e67fd0040086 (patch)
tree7b0372b379204e87c4e7a7534ad4c54ba0d23bbc /activerecord/test
parent0920065772dc6e3094df7101e28c38a183725ac9 (diff)
downloadrails-522c0fdb555d54ca68d1acfd1bd8e67fd0040086.tar.gz
rails-522c0fdb555d54ca68d1acfd1bd8e67fd0040086.tar.bz2
rails-522c0fdb555d54ca68d1acfd1bd8e67fd0040086.zip
The primary key is always initialized in the @attributes hash to nil (unless
another value has been specified).
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb2
-rw-r--r--activerecord/test/cases/serialization_test.rb3
2 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb
index 4612bc2618..9cc09194dc 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -738,7 +738,7 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
def test_select_chosen_fields_only
author = authors(:david)
- assert_equal ['body'], author.comments.select('comments.body').first.attributes.keys
+ assert_equal ['body', 'id'].sort, author.comments.select('comments.body').first.attributes.keys.sort
end
def test_get_has_many_through_belongs_to_ids_with_conditions
diff --git a/activerecord/test/cases/serialization_test.rb b/activerecord/test/cases/serialization_test.rb
index 61b04b3e37..31ba99a8ff 100644
--- a/activerecord/test/cases/serialization_test.rb
+++ b/activerecord/test/cases/serialization_test.rb
@@ -13,7 +13,8 @@ class SerializationTest < ActiveRecord::TestCase
:created_at => Time.utc(2006, 8, 1),
:awesome => false,
:preferences => { :gem => '<strong>ruby</strong>' },
- :alternative_id => nil
+ :alternative_id => nil,
+ :id => nil
}
end