mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Prevent loading association when include_data is set to false (#1710)
This should fix #1707.
This commit is contained in:
committed by
L. Preston Sego III
parent
cbca1350b9
commit
a701777bd5
@@ -75,10 +75,10 @@ module ActiveModel
|
||||
|
||||
if block
|
||||
block_value = instance_exec(serializer, &block)
|
||||
if block_value == :nil
|
||||
serializer.read_attribute_for_serialization(name)
|
||||
else
|
||||
if block_value != :nil
|
||||
block_value
|
||||
elsif @_include_data
|
||||
serializer.read_attribute_for_serialization(name)
|
||||
end
|
||||
else
|
||||
serializer.read_attribute_for_serialization(name)
|
||||
|
||||
Reference in New Issue
Block a user