Commit c047fb86 authored by Matija Čupić's avatar Matija Čupić

Disable public send cop in variables duplicates validator

parent b413a825
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
class VariableDuplicatesValidator < ActiveModel::EachValidator class VariableDuplicatesValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value) def validate_each(record, attribute, value)
if options[:scope] if options[:scope]
scoped = value.group_by { |variable| Array(options[:scope]).map { |attr| variable.send(attr) } } scoped = value.group_by { |variable| Array(options[:scope]).map { |attr| variable.send(attr) } } # rubocop:disable GitlabSecurity/PublicSend
scoped.each_value { |scope| validate_duplicates(record, attribute, scope) } scoped.each_value { |scope| validate_duplicates(record, attribute, scope) }
else else
validate_duplicates(record, attribute, value) validate_duplicates(record, attribute, value)
......
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