<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -134,7 +134,9 @@ module ActiveRecord
 
       def update_with_dirty
         if partial_updates?
-          update_without_dirty(changed)
+          # Serialized attributes should always be written in case they've been
+          # changed in place.
+          update_without_dirty(changed | self.class.serialized_attributes.keys)
         else
           update_without_dirty
         end</diff>
      <filename>activerecord/lib/active_record/dirty.rb</filename>
    </modified>
    <modified>
      <diff>@@ -191,6 +191,18 @@ class DirtyTest &lt; 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 =&gt; {:a =&gt; &quot;a&quot;})
+      topic.content[:b] = &quot;b&quot;
+      #assert topic.changed? # Known bug, will fail
+      topic.save!
+      assert_equal &quot;b&quot;, topic.content[:b]
+      topic.reload
+      assert_equal &quot;b&quot;, topic.content[:b]
+    end
+  end
+
   private
     def with_partial_updates(klass, on = true)
       old = klass.partial_updates?</diff>
      <filename>activerecord/test/cases/dirty_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>88eec8327b179cd41314e85868879b46bcf2530e</id>
    </parent>
  </parents>
  <author>
    <name>Tom Lea</name>
    <email>contrib@tomlea.co.uk</email>
  </author>
  <url>http://github.com/rails/rails/commit/decc9730959de85b4c4873986bcd33e12fa1985d</url>
  <id>decc9730959de85b4c4873986bcd33e12fa1985d</id>
  <committed-date>2008-08-12T09:18:29-07:00</committed-date>
  <authored-date>2008-08-11T10:16:58-07:00</authored-date>
  <message>Serialized attributes will now always be saved even with partial_updates turned on.

Signed-off-by: Michael Koziarski &lt;michael@koziarski.com&gt;
[#788 state:committed]</message>
  <tree>f9f33b32f3201ac01604670913166e552ac25565</tree>
  <committer>
    <name>Michael Koziarski</name>
    <email>michael@koziarski.com</email>
  </committer>
</commit>
