Fix nil error when submitting report without rule_ids
(#17713)
This commit is contained in:
parent
e3d3b4ae21
commit
1b0f9f25ed
1 changed files with 1 additions and 1 deletions
|
@ -129,6 +129,6 @@ class Report < ApplicationRecord
|
||||||
def validate_rule_ids
|
def validate_rule_ids
|
||||||
return unless violation?
|
return unless violation?
|
||||||
|
|
||||||
errors.add(:rule_ids, I18n.t('reports.errors.invalid_rules')) unless rules.size == rule_ids.size
|
errors.add(:rule_ids, I18n.t('reports.errors.invalid_rules')) unless rules.size == rule_ids&.size
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue