Before adding workers

This commit is contained in:
Jason Jordan
2026-03-20 10:46:53 -04:00
parent 3300819ed5
commit a43c8bf6b5
70 changed files with 533 additions and 457 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
class Employer < ApplicationRecord
has_many :members
has_one :id_card_configuration, class_name: 'IdCard::Configuration', dependent: :destroy
has_one :id_card_setup, class_name: 'IdCard::Setup', dependent: :destroy
scope :active, -> { where(active: true) }
scope :inactive, -> { where(active: false) }
@@ -39,7 +39,7 @@ class Employer < ApplicationRecord
end
def id_card_enabled?
self.id_card_configuration.present?
self.id_card_setup.present?
end
def claims_check_enabled?
+2 -2
View File
@@ -1,6 +1,6 @@
module IdCard
class FieldException < ApplicationRecord
belongs_to :configuration
belongs_to :setup
has_many :field_exception_items, dependent: :destroy
accepts_nested_attributes_for :field_exception_items, allow_destroy: true, reject_if: :all_blank
@@ -13,7 +13,7 @@ module IdCard
class << self
def permitted_params(params)
params.require(:id_card_configuration).permit(
params.require(:id_card_setup).permit(
field_exceptions_attributes: [
:exception_type,
:exception_value,
+2 -2
View File
@@ -1,6 +1,6 @@
module IdCard
class ExceptionItem < ApplicationRecord
belongs_to :exception
class FieldExceptionItem < ApplicationRecord
belongs_to :field_exception
belongs_to :network_logo, optional: true
belongs_to :provider_section, optional: true
+2 -2
View File
@@ -1,6 +1,6 @@
module IdCard
class Plan < ApplicationRecord
belongs_to :configuration, optional: true
belongs_to :setup, optional: true
has_many :plan_benefits, dependent: :destroy
accepts_nested_attributes_for :plan_benefits, allow_destroy: true, reject_if: :all_blank
@@ -45,7 +45,7 @@ module IdCard
# end
def permitted_params(params)
params.require(:id_card_configuration).permit(
params.require(:id_card_setup).permit(
plans_attributes: [
:id,
:title,
+1 -1
View File
@@ -4,7 +4,7 @@ module IdCard
scope :defaults, -> { where(default: true) }
def self.permitted_params(params)
params.require(:id_card_configuration).require(:provider_section).permit(
params.require(:id_card_setup).require(:provider_section).permit(
:provider_line_1,
:provider_line_2,
:provider_line_3,
@@ -1,5 +1,5 @@
module IdCard
class Configuration < ApplicationRecord
class Setup < ApplicationRecord
belongs_to :employer, class_name: 'Employer'
belongs_to :employer_logo, optional: true
belongs_to :network_logo, optional: true
@@ -37,7 +37,7 @@ module IdCard
end
def self.permitted_params(params)
params.require(:id_card_configuration).permit(
params.require(:id_card_setup).permit(
:print_name,
:network_provider,
:card_template,