before adding users

This commit is contained in:
Jason Jordan
2026-04-20 12:12:52 -04:00
parent 7ab1143db8
commit 1d9025276d
21 changed files with 286 additions and 185 deletions
+5 -2
View File
@@ -9,14 +9,17 @@ class Employer < ApplicationRecord
scope :inactive, -> { where(active: false) }
before_save :create_slug, if: :will_save_change_to_name?
before_save :deactivation_check, if: :will_save_change_to_active?
before_save :active_initialized_check, if: :will_save_change_to_active?
def create_slug
self.slug = Employer.employer_trim_name(name).parameterize
end
def deactivation_check
def active_initialized_check
if active
self.initialized = true
end
if active == false
id_card_setup&.update(active: false)
end