summaryrefslogtreecommitdiff
path: root/app/validators
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-10-30 03:48:45 +0900
committerShinya Maeda <shinya@gitlab.com>2017-10-30 03:48:45 +0900
commit478e59fe8d82b99800a2613aa4d153bf692fbd6b (patch)
tree5f734aee006c7cfee86c8151e3b6f94846b15299 /app/validators
parentd0cff7f5855f91b5479f9fdaa39d8d95ec691a9e (diff)
downloadgitlab-ce-478e59fe8d82b99800a2613aa4d153bf692fbd6b.tar.gz
specs for models. Improved details.
Diffstat (limited to 'app/validators')
-rw-r--r--app/validators/cluster_name_validator.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/validators/cluster_name_validator.rb b/app/validators/cluster_name_validator.rb
index 6c9850af30f..13ec342f399 100644
--- a/app/validators/cluster_name_validator.rb
+++ b/app/validators/cluster_name_validator.rb
@@ -8,7 +8,7 @@ class ClusterNameValidator < ActiveModel::EachValidator
record.errors.add(attribute, " has to be present")
end
elsif record.gcp?
- if record.persisted? && record.name != value
+ if record.persisted? && record.name_changed?
record.errors.add(attribute, " can not be changed because it's synchronized with provider")
end