rails/rails — pull request #13984 by zzak (2014-02-09 11:02:57+00:00)
Title: Refactor ActiveModel::Serialization#serializable_hash

This commit extracts some of the conditional logic used for building a
serializable hash of attributes and methods, adding three new private
methods:

* serializable_attribute_names(attribute_keys, options = nil)
Returns a Hash of serialized attributes including explictly specified
keys and excluding keys marked as except.

* set_serializable_attributes(attribute_names)
Initial setup of serialized attributes hash given an Array of
attribute names.

* serializable_methods_hash(methods)
Returns a Hash of serialized method names given from #serialized_hash
options, to be merged with the Hash setup in set_serializable_attributes