DB restructure, print page

This commit is contained in:
Jason Jordan
2026-03-13 08:47:13 -04:00
parent 6a068243f4
commit 8c885b3e76
73 changed files with 1362 additions and 325 deletions
@@ -0,0 +1,27 @@
module IdCard
class ExceptionItem < ApplicationRecord
belongs_to :exception
belongs_to :network_logo, optional: true
belongs_to :provider_section, optional: true
validate :only_one_exception_field_present
FIELDS_TO_VALIDATE = [:field_value, :card_logo_file_id, :card_provider_id].freeze
VALID_FIELD_NAMES = ['network_logo', 'provider_section', 'effective_date']
validates :field_name, inclusion: { in: VALID_FIELD_NAMES,
message: "%{value} is not a valid Id Card Field Name" }
private
def only_one_exception_field_present
present_fields = FIELDS_TO_VALIDATE.count { |field| self[field].present? }
if present_fields != 1
errors.add(:base, "Only one exception field can be present at a time")
end
end
end
end