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/membership_application.rb

20 lines
675 B
Ruby
Raw Normal View History

2018-11-26 08:39:32 -05:00
# frozen_string_literal: true
class MembershipApplication < ApplicationRecord
belongs_to :country_state, optional: true
2018-11-26 08:39:32 -05:00
validates :first_name, presence: true
validates :last_name, presence: true
validates :date_of_birth, presence: true
validates :email, presence: true
validates :phone_number, presence: true
2018-11-28 09:05:58 -05:00
before_validation do
self.middle_name = nil if middle_name.blank?
self.occupation = nil if occupation.blank?
self.telegram_username = nil if telegram_username.blank?
self.organization_membership = nil if organization_membership.blank?
self.comment = nil if comment.blank?
end
2018-11-26 08:39:32 -05:00
end