rails/rails — pull request #13423 by kbrock (2013-12-20 18:23:25+00:00)
Title: Ability to turn off auto save of serialized attributes

Currently, serialized attributes are saved to the database on every save.

This change introduces `safe_serialized_attributes` which will turn this behavior off.

If serialized attribtues are changed inplace, then the user can use `attribute_will_change!`.

```ruby
topic = Topic.create!(:content => {:a => "a"})

topic.save! #saves to database
topic.save! #saves to database
Topic.safe_serialized_attributes = false
topic.save! #no longer saves to database

topic.content_will_change!
topic.content[:b] = "b"
topic.save! #saves to database
topic.save! #no longer saves to database
```

This is one option for rails#8328