mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Handle special-case of Array serializer with unserializable elements
This commit is contained in:
committed by
João Moura
parent
cf77786da2
commit
e5d1e40dbd
@@ -211,7 +211,7 @@ module ActiveModel
|
||||
association_value,
|
||||
options.except(:serializer).merge(serializer_from_options(association_options))
|
||||
)
|
||||
rescue NoMethodError
|
||||
rescue ActiveModel::Serializer::ArraySerializer::Error
|
||||
# 1. Failure to serialize an element in a collection, e.g. [ {hi: "Steve" } ] will fail
|
||||
# with NoMethodError when the ArraySerializer finds no serializer for the hash { hi: "Steve" },
|
||||
# and tries to call new on that nil.
|
||||
|
||||
Reference in New Issue
Block a user