Employers working - onboarding to card print
CI / scan_ruby (push) Failing after 10m41s
CI / lint (push) Failing after 7m31s
CI / test (push) Failing after 8m29s
Docker / build-and-test-image (push) Failing after 11m32s

This commit is contained in:
Jason Jordan
2026-01-15 11:37:50 -05:00
parent 0464ba8929
commit 4fac3b1036
108 changed files with 4113 additions and 431 deletions
+3 -3
View File
@@ -1,15 +1,15 @@
class Plan < ApplicationRecord
belongs_to :employer_setup_process
belongs_to :employer
has_many :plan_benefits, dependent: :destroy
accepts_nested_attributes_for :plan_benefits, allow_destroy: true, reject_if: :all_blank
after_initialize :create_default_benefits, if: :new_record?
# after_initialize :create_default_benefits, if: :new_record?
private
def create_default_benefits
def build_and_create_default_benefits
benefits = IdCardBenefitsTemplate.find_by(title: "BLANK").id_card_benefits.sort_by(&:sequence)
benefits.each do |ben|
plan_benefits.new(benefit_desc: ben.benefit_desc, sequence: ben.sequence)