active_model_serializers/lib/active_model/serializer/configuration.rb
2015-10-21 16:53:26 -05:00

27 lines
691 B
Ruby

module ActiveModel
class Serializer
module Configuration
include ActiveSupport::Configurable
extend ActiveSupport::Concern
# Configuration options may also be set in
# Serializers and Adapters
included do |base|
config = base.config
config.collection_serializer = ActiveModel::Serializer::CollectionSerializer
def config.array_serializer=(collection_serializer)
self.collection_serializer = collection_serializer
end
def config.array_serializer
collection_serializer
end
config.adapter = :attributes
config.jsonapi_resource_type = :plural
end
end
end
end