From 51977bc261f83091a31c7f3d6f8dbd59cec1d2a3 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Tue, 4 Sep 2007 17:32:48 +0000 Subject: Fix bug where unserializing an attribute attempts to modify a frozen @attributes hash for a deleted record. [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7406 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/attribute_methods_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'activerecord/test/attribute_methods_test.rb') diff --git a/activerecord/test/attribute_methods_test.rb b/activerecord/test/attribute_methods_test.rb index 0fa13c65ca..c031d78357 100755 --- a/activerecord/test/attribute_methods_test.rb +++ b/activerecord/test/attribute_methods_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'fixtures/topic' class AttributeMethodsTest < Test::Unit::TestCase def setup @@ -46,4 +47,12 @@ class AttributeMethodsTest < Test::Unit::TestCase assert_equal ['title', 1, 2, 3], topic.send(meth, 1, 2, 3) end end + + def test_should_unserialize_attributes_for_frozen_records + myobj = {:value1 => :value2} + topic = Topic.create("content" => myobj) + topic.freeze + assert_equal myobj, topic.content + + end end -- cgit v1.2.3