module ActionController::Serialization
def get_serializer(resource, options = {})
def get_serializer(resource, options = {}) unless use_adapter? warn 'ActionController::Serialization#use_adapter? has been removed. '\ "Please pass 'adapter: false' or see ActiveSupport::SerializableResource.new" options[:adapter] = false end serializable_resource = ActiveModelSerializers::SerializableResource.new(resource, options) serializable_resource.serialization_scope ||= options.fetch(:scope) { serialization_scope } serializable_resource.serialization_scope_name = options.fetch(:scope_name) { _serialization_scope } # For compatibility with the JSON renderer: `json.to_json(options) if json.is_a?(String)`. # Otherwise, since `serializable_resource` is not a string, the renderer would call # `to_json` on a String and given odd results, such as `"".to_json #=> '""'` serializable_resource.adapter.is_a?(String) ? serializable_resource.adapter : serializable_resource end
def serialization_scope
def serialization_scope return unless _serialization_scope && respond_to?(_serialization_scope, true) send(_serialization_scope) end
def use_adapter?
def use_adapter? true end