Commit d5c5cbcd authored by Shinya Maeda's avatar Shinya Maeda

Use exist? instead of any? to check clusters existsnce. (LIMIT 1)

parent 7798b495
......@@ -94,7 +94,7 @@ module Clusters
private
def unique_environment_scope
if project.clusters.where(environment_scope: environment_scope).any?
if project.clusters.where(environment_scope: environment_scope).exists?
errors.add(:base, "cannot add duplicated environment scope")
return false
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