Commit 69fb7f31 authored by Ohad Dahan's avatar Ohad Dahan

#196371 removing unneeded DB query

parent 5aa6e008
......@@ -186,7 +186,11 @@ class Namespace < ApplicationRecord
# any ancestor can disable emails for all descendants
def emails_disabled?
strong_memoize(:emails_disabled) do
if parent_id
self_and_ancestors.where(emails_disabled: true).exists?
else
!!emails_disabled
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment