Commit b7b49c4a authored by Mike Greiling's avatar Mike Greiling

prefer !x.exists? instead of x.none? to prevent unnecessary instantiation of records

parent 1c3b3fac
...@@ -129,11 +129,11 @@ class Group < Namespace ...@@ -129,11 +129,11 @@ class Group < Namespace
end end
def visibility_level_allowed_by_projects?(level = self.visibility_level) def visibility_level_allowed_by_projects?(level = self.visibility_level)
projects.where('visibility_level > ?', level).none? !projects.where('visibility_level > ?', level).exists?
end end
def visibility_level_allowed_by_sub_groups?(level = self.visibility_level) def visibility_level_allowed_by_sub_groups?(level = self.visibility_level)
children.where('visibility_level > ?', level).none? !children.where('visibility_level > ?', level).exists?
end end
def visibility_level_allowed?(level = self.visibility_level) def visibility_level_allowed?(level = self.visibility_level)
......
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