diff options
Diffstat (limited to 'app/validators')
-rw-r--r-- | app/validators/variable_duplicates_validator.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/validators/variable_duplicates_validator.rb b/app/validators/variable_duplicates_validator.rb index 90193e85f2a..d36a56e81b9 100644 --- a/app/validators/variable_duplicates_validator.rb +++ b/app/validators/variable_duplicates_validator.rb @@ -21,6 +21,7 @@ class VariableDuplicatesValidator < ActiveModel::EachValidator private + # rubocop: disable CodeReuse/ActiveRecord def validate_duplicates(record, attribute, values) duplicates = values.reject(&:marked_for_destruction?).group_by(&:key).select { |_, v| v.many? }.map(&:first) if duplicates.any? @@ -29,4 +30,5 @@ class VariableDuplicatesValidator < ActiveModel::EachValidator record.errors.add(attribute, error_message) end end + # rubocop: enable CodeReuse/ActiveRecord end |