Commit 48316183 authored by Shinya Maeda's avatar Shinya Maeda

Fix validation of duplicated environment scope

parent 63ae4e98
......@@ -27,7 +27,7 @@ module Clusters
accepts_nested_attributes_for :platform_kubernetes, update_only: true
validates :name, cluster_name: true
validate :unique_environment_scope, if: :has_project?
validate :unique_environment_scope
validate :restrict_modification, on: :update
delegate :status, to: :provider, allow_nil: true
......@@ -110,9 +110,5 @@ module Clusters
true
end
def has_project?
projects.exists?
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