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