Created
October 18, 2012 01:38
-
-
Save venkatd/3909390 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::Base.class_eval do | |
class_attribute :no_serialize_update | |
self.no_serialize_update = false | |
end | |
ActiveRecord::AttributeMethods::Dirty.class_eval do | |
# Serialized attributes should always be written in case they've been | |
# changed in place. | |
def keys_for_partial_update | |
if self.no_serialize_update | |
super | |
else | |
super + changed_serialized_columns | |
end | |
end | |
def changed_serialized_columns | |
# ?? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment