1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/models/passport_confirmation.rb

19 lines
361 B
Ruby
Raw Normal View History

2018-11-30 03:13:54 -05:00
# frozen_string_literal: true
class PassportConfirmation < ApplicationRecord
belongs_to :passport
2018-12-01 21:28:34 -05:00
belongs_to :account
2018-11-30 03:13:54 -05:00
2018-12-01 21:28:34 -05:00
validates :account_id, uniqueness: { scope: :passport_id }
2018-12-01 06:05:50 -05:00
validate :passport_has_image
private
def passport_has_image
return if passport.nil?
errors.add :passport, 'must have an image' if passport.image.nil?
end
2018-11-30 03:13:54 -05:00
end