Files
baclight/app/models/id_card/exception.rb
T
2026-03-06 10:56:20 -05:00

13 lines
430 B
Ruby

module IdCard
class Exception < ApplicationRecord
belongs_to :setup
has_many :exception_items
accepts_nested_attributes_for :exception_items, allow_destroy: true, reject_if: :all_blank
VALID_TYPES = ['zipcode', 'state', 'family_id']
validates :type, inclusion: { in: VALID_TYPES,
message: "%{value} is not a valid exception type" }
end
end