summaryrefslogtreecommitdiff
path: root/app/models/namespace.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r--app/models/namespace.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 74774a22a37..621a98e9ab6 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -186,7 +186,11 @@ class Namespace < ApplicationRecord
# any ancestor can disable emails for all descendants
def emails_disabled?
strong_memoize(:emails_disabled) do
- self_and_ancestors.where(emails_disabled: true).exists?
+ if parent_id
+ self_and_ancestors.where(emails_disabled: true).exists?
+ else
+ !!emails_disabled
+ end
end
end