don't reload files when unnecessary in AR#all_models
Change-Id: Ib902f5f62c900364f0f1e4a64dc5686468bcf030 Reviewed-on: https://gerrit.instructure.com/60478 Tested-by: Jenkins Reviewed-by: Cody Cutrer <cody@instructure.com> Product-Review: James Williams <jamesw@instructure.com> QA-Review: James Williams <jamesw@instructure.com>
This commit is contained in:
parent
4efa07a418
commit
6d9ec5bf02
|
@ -69,7 +69,10 @@ class ActiveRecord::Base
|
|||
"#{Rails.root}/app/models/**/*.rb",
|
||||
"#{Rails.root}/vendor/plugins/*/app/models/**/*.rb",
|
||||
"#{Rails.root}/gems/plugins/*/app/models/**/*.rb",
|
||||
].sort.each { |file| ActiveSupport::Dependencies.require_or_load(file) }
|
||||
].sort.each do |file|
|
||||
next if const_defined?(file.sub(%r{.*/app/models/(.*)\.rb$}, '\1').camelize)
|
||||
ActiveSupport::Dependencies.require_or_load(file)
|
||||
end
|
||||
ActiveRecord::Base.descendants
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue