Make serializer lookup configurable (#1757)

This commit is contained in:
L. Preston Sego III
2016-11-16 12:38:40 -05:00
committed by Yohan Robert
parent d0de53cbb2
commit d31d741f43
10 changed files with 321 additions and 11 deletions

View File

@@ -32,6 +32,26 @@ module ActiveModel
config.jsonapi_include_toplevel_object = false
config.include_data_default = true
# For configuring how serializers are found.
# This should be an array of procs.
#
# The priority of the output is that the first item
# in the evaluated result array will take precedence
# over other possible serializer paths.
#
# i.e.: First match wins.
#
# @example output
# => [
# "CustomNamespace::ResourceSerializer",
# "ParentSerializer::ResourceSerializer",
# "ResourceNamespace::ResourceSerializer" ,
# "ResourceSerializer"]
#
# If CustomNamespace::ResourceSerializer exists, it will be used
# for serialization
config.serializer_lookup_chain = ActiveModelSerializers::LookupChain::DEFAULT.dup
config.schema_path = 'test/support/schemas'
end
end