Skip to content

Commit

Permalink
Use ATTRIBUTES_TO_CHECK
Browse files Browse the repository at this point in the history
  • Loading branch information
hunchr committed Aug 22, 2024
1 parent 1e68646 commit 063b2a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/person/data_quality_issue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
# index_person_data_quality_issues_on_person_and_attribute_and_key (key) UNIQUE

class Person::DataQualityIssue < ApplicationRecord
VALID_ATTRIBUTES = Person.column_names + ["phone_numbers"]

belongs_to :person

enum severity: {info: 1, warning: 2, error: 3}
Expand All @@ -48,6 +46,8 @@ def message
private

def person_attribute_exists
errors.add(:attr, :invalid) unless VALID_ATTRIBUTES.include?(attr)
return unless People::DataQualityChecker::ATTRIBUTES_TO_CHECK.include?(attr)

errors.add(:attr, :invalid)
end
end

0 comments on commit 063b2a5

Please sign in to comment.