Before adding workers
This commit is contained in:
@@ -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?
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
Reference in New Issue
Block a user