Note that we dup the entire reflection instance

This commit is contained in:
Benjamin Fleischer
2018-11-01 14:20:20 -05:00
parent c7e847fc72
commit b358271ef5
2 changed files with 5 additions and 2 deletions

View File

@@ -347,7 +347,7 @@ module ActiveModel
return Enumerator.new {} unless object
Enumerator.new do |y|
(@reflections ||= self.class._reflections.deep_dup).each do |key, reflection|
(self.instance_reflections ||= self.class._reflections.deep_dup).each do |key, reflection|
next if reflection.excluded?(self)
next unless include_directive.key?(key)
@@ -411,6 +411,6 @@ module ActiveModel
protected
attr_accessor :instance_options, :reflections
attr_accessor :instance_options, :instance_reflections
end
end