Commit d4489947 authored by Thong Kuah's avatar Thong Kuah

Removes un-necessary self inside method

parent 7edf3f51
...@@ -10,12 +10,12 @@ module EE ...@@ -10,12 +10,12 @@ module EE
end end
def unique_environment_scope def unique_environment_scope
if project && project.clusters.where(environment_scope: environment_scope).where.not(id: self.id).exists? if project && project.clusters.where(environment_scope: environment_scope).where.not(id: id).exists?
errors.add(:base, "cannot add duplicated environment scope") errors.add(:base, "cannot add duplicated environment scope")
return false return false
end end
if group && group.clusters.where(environment_scope: environment_scope).where.not(id: self.id).exists? if group && group.clusters.where(environment_scope: environment_scope).where.not(id: id).exists?
errors.add(:base, 'cannot add duplicated environment scope') errors.add(:base, 'cannot add duplicated environment scope')
return false return false
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