Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/extensions/descendant_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def scoped_name(name, scopes)

module ArDescendantsWithLoader
def descendants
unless defined? @loaded_descendants
if Vmdb::Application.instance.initialized? && !defined? @loaded_descendants
@loaded_descendants = true
DescendantLoader.instance.load_subclasses(self)
end
Expand All @@ -275,7 +275,7 @@ def descendants
# https://github.com/rails/rails/commit/8f8aa857e084b76b1120edaa9bb9ce03ba1e6a19
# We need to get in front of it, like we do for descendants.
def subclasses
unless defined? @loaded_descendants
if Vmdb::Application.instance.initialized? && !defined? @loaded_descendants
@loaded_descendants = true
DescendantLoader.instance.load_subclasses(self)
end
Expand Down