Fix thread unsafe behavior

This commit is contained in:
LongCB 2018-08-16 10:50:36 +07:00 committed by Benjamin Fleischer
parent 127b04ba33
commit c7e847fc72

View File

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