aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/attribute_methods_test.rb
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-09-04 17:32:48 +0000
committerRick Olson <technoweenie@gmail.com>2007-09-04 17:32:48 +0000
commit51977bc261f83091a31c7f3d6f8dbd59cec1d2a3 (patch)
treeb46482717286f9fe446e96dae1c221d8ab946c74 /activerecord/test/attribute_methods_test.rb
parent3bbef581afc4bbe1f6280b56a1b6a6a12133c9d9 (diff)
downloadrails-51977bc261f83091a31c7f3d6f8dbd59cec1d2a3.tar.gz
rails-51977bc261f83091a31c7f3d6f8dbd59cec1d2a3.tar.bz2
rails-51977bc261f83091a31c7f3d6f8dbd59cec1d2a3.zip
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
Diffstat (limited to 'activerecord/test/attribute_methods_test.rb')
-rwxr-xr-xactiverecord/test/attribute_methods_test.rb9
1 files changed, 9 insertions, 0 deletions
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