Browse Source

Fix nil error when submitting report without `rule_ids` (#17713)

closed-social-glitch-2
Eugen Rochko 2 years ago
committed by GitHub
parent
commit
292c75aa31
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/models/report.rb

+ 1
- 1
app/models/report.rb View File

@ -129,6 +129,6 @@ class Report < ApplicationRecord
def validate_rule_ids
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

Loading…
Cancel
Save