mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Merge pull request #1214 from NullVoxPopuli/issue/1211-failing-test
Fix #1211, include_tree is null when using the key: options
This commit is contained in:
@@ -92,7 +92,8 @@ module ActiveModel
|
||||
|
||||
Enumerator.new do |y|
|
||||
self.class._reflections.each do |reflection|
|
||||
next unless include_tree.key?(reflection.name)
|
||||
key = reflection.options.fetch(:key, reflection.name)
|
||||
next unless include_tree.key?(key)
|
||||
y.yield reflection.build_association(self, instance_options)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user