summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-02-14 20:26:54 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-02-14 20:26:54 +0100
commit48db60e47987a3a7c08856423daf7713eb256e74 (patch)
tree930335230088ad749dab70a02a5e38017089963d /app
parent9a5ba5c67444d9b71597dd8c43955a055a047100 (diff)
downloadgitlab-ce-48db60e47987a3a7c08856423daf7713eb256e74.tar.gz
Refactor variable duplicates error message
Diffstat (limited to 'app')
-rw-r--r--app/validators/variable_duplicates_validator.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/validators/variable_duplicates_validator.rb b/app/validators/variable_duplicates_validator.rb
index ae9ebdf28cf..37e0a476399 100644
--- a/app/validators/variable_duplicates_validator.rb
+++ b/app/validators/variable_duplicates_validator.rb
@@ -21,7 +21,7 @@ class VariableDuplicatesValidator < ActiveModel::EachValidator
duplicates = values.reject(&:marked_for_destruction?).group_by(&:key).select { |_, v| v.many? }.map(&:first)
if duplicates.any?
error_message = "has duplicate variables (#{duplicates.join(", ")})"
- error_message += " in #{options[:scope]} scope" if options[:scope]
+ error_message += " for #{values.first.send(options[:scope])} scope" if options[:scope] # rubocop:disable GitlabSecurity/PublicSend
record.errors.add(attribute, error_message)
end
end