This repository has been archived on 2023-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
2018-11-26 13:39:32 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class MembershipApplication < ApplicationRecord
|
|
|
|
validates :first_name, presence: true
|
|
|
|
validates :last_name, presence: true
|
2018-11-26 16:34:42 +00:00
|
|
|
validates :date_of_birth, presence: true
|
2018-11-28 13:09:23 +00:00
|
|
|
validates :email, presence: true
|
|
|
|
validates :phone_number, presence: true
|
2018-11-28 14:05:58 +00: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 13:39:32 +00:00
|
|
|
end
|