mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Use reflection key since we have it
This commit is contained in:
parent
3ba4a8c9b2
commit
43c3c231ef
@ -337,9 +337,8 @@ module ActiveModel
|
|||||||
return Enumerator.new unless object
|
return Enumerator.new unless object
|
||||||
|
|
||||||
Enumerator.new do |y|
|
Enumerator.new do |y|
|
||||||
self.class._reflections.values.each do |reflection|
|
self.class._reflections.each do |key, reflection|
|
||||||
next if reflection.excluded?(self)
|
next if reflection.excluded?(self)
|
||||||
key = reflection.options.fetch(:key, reflection.name)
|
|
||||||
next unless include_directive.key?(key)
|
next unless include_directive.key?(key)
|
||||||
|
|
||||||
y.yield reflection.build_association(self, instance_options, include_slice)
|
y.yield reflection.build_association(self, instance_options, include_slice)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user