diff --git a/app/models/tenant.rb b/app/models/tenant.rb index df682f43e7f..b6ceee2c13f 100644 --- a/app/models/tenant.rb +++ b/app/models/tenant.rb @@ -217,7 +217,11 @@ def self.default_tenant # # @return [Tenant] the root tenant def self.root_tenant - @root_tenant ||= in_my_region.roots.first + @root_tenant ||= root_tenant_without_cache + end + + def self.root_tenant_without_cache + in_my_region.roots.first end # NOTE: returns the root tenant @@ -303,7 +307,7 @@ def nil_blanks # validates that there is only one tree def validate_only_one_root unless parent_id || parent - root = self.class.root_tenant + root = self.class.root_tenant_without_cache errors.add(:parent, "required") if root && root != self end end