diff options
author | kennyj <kennyj@gmail.com> | 2013-04-25 02:04:07 +0900 |
---|---|---|
committer | kennyj <kennyj@gmail.com> | 2013-04-25 03:01:19 +0900 |
commit | 8c8d34fa55b471858b7466789830ff936c550a8f (patch) | |
tree | c0e00cf34d93953e0a6e600608b91ac98379ff07 /activerecord/test | |
parent | 5bdd76fc3b83f9cf3320905daae390ced4e7bf33 (diff) | |
download | rails-8c8d34fa55b471858b7466789830ff936c550a8f.tar.gz rails-8c8d34fa55b471858b7466789830ff936c550a8f.tar.bz2 rails-8c8d34fa55b471858b7466789830ff936c550a8f.zip |
Added testcase for #10067 and a CHANGELOG entry about this change.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/serialized_attribute_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/test/cases/serialized_attribute_test.rb b/activerecord/test/cases/serialized_attribute_test.rb index 726338db14..d0e012902e 100644 --- a/activerecord/test/cases/serialized_attribute_test.rb +++ b/activerecord/test/cases/serialized_attribute_test.rb @@ -1,5 +1,6 @@ require 'cases/helper' require 'models/topic' +require 'models/reply' require 'models/person' require 'models/traffic_light' require 'bcrypt' @@ -241,4 +242,17 @@ class SerializedAttributeTest < ActiveRecord::TestCase assert_equal [], light.state assert_equal [], light.long_state end + + def test_serialized_columh_should_not_be_wrapped_twice + Topic.serialize(:content, MyObject) + + myobj = MyObject.new('value1', 'value2') + Topic.create(content: myobj) + Topic.create(content: myobj) + + Topic.all.each do |topic| + type = topic.instance_variable_get("@columns_hash")["content"] + assert !type.instance_variable_get("@column").is_a?(ActiveRecord::AttributeMethods::Serialization::Type) + end + end end |