Sha256: f77546630ea42dd4f62bc31f6806e0df06f706f20a82c1a5ffa5d0905743184f

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

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
        config.serializer_lookup_enabled = true

        def config.array_serializer=(collection_serializer)
          self.collection_serializer = collection_serializer
        end

        def config.array_serializer
          collection_serializer
        end

        config.default_includes = '*'
        config.adapter = :attributes
        config.jsonapi_resource_type = :plural
        config.jsonapi_version = '1.0'
        config.jsonapi_toplevel_meta = {}
        # Make JSON API top-level jsonapi member opt-in
        # ref: http://jsonapi.org/format/#document-top-level
        config.jsonapi_include_toplevel_object = false
        config.key_transform = nil

        config.schema_path = 'test/support/schemas'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_model_serializers-0.10.2 lib/active_model/serializer/configuration.rb
active_model_serializers-0.10.1 lib/active_model/serializer/configuration.rb