aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/dirty_test.rb
diff options
context:
space:
mode:
authorTom Lea <contrib@tomlea.co.uk>2008-08-11 18:16:58 +0100
committerMichael Koziarski <michael@koziarski.com>2008-08-12 18:15:50 +0200
commit992fda16ed662f028700d63a8dcbd1837f1d58ab (patch)
tree71fc235f3141b4ae5be912c77b8830a82290fb6b /activerecord/test/cases/dirty_test.rb
parent81c12d1f6359eb5e52b376f1f3552097a144cc8b (diff)
downloadrails-992fda16ed662f028700d63a8dcbd1837f1d58ab.tar.gz
rails-992fda16ed662f028700d63a8dcbd1837f1d58ab.tar.bz2
rails-992fda16ed662f028700d63a8dcbd1837f1d58ab.zip
Serialized attributes will now always be saved even with partial_updates turned on.
Signed-off-by: Michael Koziarski <michael@koziarski.com> [#788 state:committed]
Diffstat (limited to 'activerecord/test/cases/dirty_test.rb')
-rw-r--r--activerecord/test/cases/dirty_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/dirty_test.rb b/activerecord/test/cases/dirty_test.rb
index e5e022050d..feb47a15a8 100644
--- a/activerecord/test/cases/dirty_test.rb
+++ b/activerecord/test/cases/dirty_test.rb
@@ -191,6 +191,18 @@ class DirtyTest < ActiveRecord::TestCase
assert !pirate.changed?
end
+ def test_save_should_store_serialized_attributes_even_with_partial_updates
+ with_partial_updates(Topic) do
+ topic = Topic.create!(:content => {:a => "a"})
+ topic.content[:b] = "b"
+ #assert topic.changed? # Known bug, will fail
+ topic.save!
+ assert_equal "b", topic.content[:b]
+ topic.reload
+ assert_equal "b", topic.content[:b]
+ end
+ end
+
private
def with_partial_updates(klass, on = true)
old = klass.partial_updates?