beta build
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
class Employer < ApplicationRecord
|
||||
include EmployerAutomation
|
||||
belongs_to :broker, optional: true
|
||||
has_many :members, dependent: :destroy
|
||||
accepts_nested_attributes_for :members, allow_destroy: true, reject_if: :all_blank
|
||||
has_one :id_card_setup, class_name: 'IdCard::Setup', dependent: :destroy
|
||||
@@ -46,6 +47,13 @@ class Employer < ApplicationRecord
|
||||
}
|
||||
end
|
||||
|
||||
def employer_member_keys_by_plan(pb_product_key)
|
||||
{
|
||||
pl_plan_key: self.pl_plan_key,
|
||||
member_keys: self.plans.find_by(pb_product_key: pb_product_key).members.pluck(:pb_entity_key)
|
||||
}
|
||||
end
|
||||
|
||||
def name_to_logo_filename(extension)
|
||||
Employer.employer_trim_name(self.name).titleize.gsub(/[^a-zA-Z]/, '').concat('Logo').concat(extension.downcase)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user