aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRaimonds Simanovskis <raimonds.simanovskis@gmail.com>2011-02-09 13:11:06 +0200
committerAaron Patterson <aaron.patterson@gmail.com>2011-02-09 09:19:56 -0800
commitc567ccbb1738969345b29297e40a9aee87a97391 (patch)
tree7510e1521643180ddd8ec4aee1af96e527f16c75 /activerecord/test
parentf48d32c0cff36cb505443ff72738def3a82c2886 (diff)
downloadrails-c567ccbb1738969345b29297e40a9aee87a97391.tar.gz
rails-c567ccbb1738969345b29297e40a9aee87a97391.tar.bz2
rails-c567ccbb1738969345b29297e40a9aee87a97391.zip
bugfix for serialized_attributes to be class specific
previously serialized_attributes were kept as class attribute of ActiveRecord::Base - if some attribute was defined as serialized in one subclass then it was serialized in all other subclasses as well (if it had the same name)
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/attribute_methods_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb
index 88eaea62e8..dfacf58da8 100644
--- a/activerecord/test/cases/attribute_methods_test.rb
+++ b/activerecord/test/cases/attribute_methods_test.rb
@@ -8,6 +8,7 @@ require 'models/topic'
require 'models/company'
require 'models/category'
require 'models/reply'
+require 'models/contact'
class AttributeMethodsTest < ActiveRecord::TestCase
fixtures :topics, :developers, :companies, :computers
@@ -609,6 +610,10 @@ class AttributeMethodsTest < ActiveRecord::TestCase
Object.send(:undef_method, :title) # remove test method from object
end
+ def test_list_of_serialized_attributes
+ assert_equal %w(content), Topic.serialized_attributes.keys
+ assert_equal %w(preferences), Contact.serialized_attributes.keys
+ end
private
def cached_columns