Commit 006322cf authored by rubic0n's avatar rubic0n

Remove Hash allocation

merge! takes a Hash as an argument. Rather than allocating a Hash,
just use two different `=` calls, to achieve the same result.
parent a623252c
......@@ -11,7 +11,10 @@ class ActiveModel::Serializer::Reflection
def build_association(parent_serializer, parent_serializer_options, include_slice = {})
serializer = options[:serializer]
parent_serializer_options.merge!(named_contexts: serializer._named_contexts, context_extensions: serializer._context_extensions) if serializer.respond_to?(:_named_contexts)
if serializer.respond_to?(:_named_contexts)
parent_serializer_options[:named_contexts] = serializer._named_contexts
parent_serializer_options[:context_extensions] = serializer._context_extensions
association_options = {
parent_serializer: parent_serializer,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment