Prod build process
This commit is contained in:
@@ -4,12 +4,18 @@ class Employer < ApplicationRecord
|
||||
accepts_nested_attributes_for :members, allow_destroy: true, reject_if: :all_blank
|
||||
has_one :id_card_setup, class_name: 'IdCard::Setup', dependent: :destroy
|
||||
has_many :plans, class_name: 'IdCard::Plan', through: :id_card_setup
|
||||
has_many :print_data, class_name: 'IdCard::PrintData', dependent: :destroy
|
||||
|
||||
validates :name, :slug, :effective_date, presence: true
|
||||
validates :group_number, :pl_plan_key, :company_pb_entity_key, :plan_id, presence: true, if: -> { initialized }
|
||||
|
||||
validates :name, :slug, :group_number, :pl_plan_key, :company_pb_entity_key, :plan_id, uniqueness: true, allow_blank: true
|
||||
|
||||
scope :active, -> { where(active: true) }
|
||||
scope :inactive, -> { where(active: false) }
|
||||
|
||||
before_save :create_slug, if: :will_save_change_to_name?
|
||||
before_save :active_initialized_check, if: :will_save_change_to_active?
|
||||
before_validation :create_slug, if: :will_save_change_to_name?
|
||||
before_validation :active_initialized_check, if: :will_save_change_to_active?
|
||||
|
||||
|
||||
def create_slug
|
||||
|
||||
Reference in New Issue
Block a user