Created
February 13, 2013 23:02
-
-
Save yarmand/4949200 to your computer and use it in GitHub Desktop.
code for blog post
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
class User | |
alias_method :super_serializable_hash, :serializable_hash | |
def serializable_hash(options = {}) | |
options.merge! { | |
:only => self.attributes.keys.map(&:to_sym) - | |
(self.class.deprecated_attributes || | |
[]).map(&:to_sym) | |
} | |
super_serializable_hash(options) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment