Skip to content

Instantly share code, notes, and snippets.

@yarmand
Created February 13, 2013 23:02
Show Gist options
  • Save yarmand/4949200 to your computer and use it in GitHub Desktop.
Save yarmand/4949200 to your computer and use it in GitHub Desktop.
code for blog post
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