mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Note that we dup the entire reflection instance
This commit is contained in:
@@ -151,6 +151,9 @@ module ActiveModel
|
||||
# @yield [ActiveModel::Serializer]
|
||||
# @return [:nil, associated resource or resource collection]
|
||||
def value(serializer, include_slice)
|
||||
# NOTE(BF): This method isn't thread-safe because the _reflections class attribute is not thread-safe
|
||||
# Therefore, when we build associations from reflections, we dup the entire reflection instance.
|
||||
# Better solutions much appreciated!
|
||||
@object = serializer.object
|
||||
@scope = serializer.scope
|
||||
|
||||
|
||||
Reference in New Issue
Block a user