class ActiveModel::Serializer
def as_json(options={})
Returns a json representation of the serializable
def as_json(options={}) if root = options.fetch(:root, @options.fetch(:root, _root)) @options[:hash] = hash = {} @options[:unique_values] = {} hash.merge!(root => serializable_hash) hash else serializable_hash end end