class ActiveModel::Serializer
def embed(type, options={})
def embed(type, options={}) CONFIG.embed = type if EMBED_IN_ROOT_OPTIONS.any? { |opt| options[opt].present? } CONFIG.embed_in_root = true end if options[:embed_in_root_key].present? CONFIG.embed_in_root_key = options[:embed_in_root_key] end ActiveSupport::Deprecation.warn <<-WARN ice: embed is deprecated. ** e of .embed method on a Serializer will be soon removed, as this should have a global scope and not a class scope. use the global .setup method instead: Model::Serializer.setup do |config| ig.embed = :#{type} ig.embed_in_root = #{CONFIG.embed_in_root || false} WARN end