We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ba4a8c commit 43c3c23Copy full SHA for 43c3c23
lib/active_model/serializer.rb
@@ -337,9 +337,8 @@ def associations(include_directive = ActiveModelSerializers.default_include_dire
337
return Enumerator.new unless object
338
339
Enumerator.new do |y|
340
- self.class._reflections.values.each do |reflection|
+ self.class._reflections.each do |key, reflection|
341
next if reflection.excluded?(self)
342
- key = reflection.options.fetch(:key, reflection.name)
343
next unless include_directive.key?(key)
344
345
y.yield reflection.build_association(self, instance_options, include_slice)
0 commit comments