jasper print speed refactor working
This commit is contained in:
@@ -46,6 +46,13 @@ class Employer < ApplicationRecord
|
||||
false
|
||||
end
|
||||
|
||||
def employer_member_keys
|
||||
{
|
||||
pl_plan_key: self.pl_plan_key,
|
||||
member_keys: self.members.pluck(:pb_entity_key)
|
||||
}
|
||||
end
|
||||
|
||||
def name_to_logo_filename(extension)
|
||||
self.employer_trim_name(self.name).titleize.gsub(/[^a-zA-Z]/, '').concat('Logo').concat(extension.downcase)
|
||||
end
|
||||
|
||||
@@ -36,6 +36,10 @@ module IdCard
|
||||
plan
|
||||
end
|
||||
|
||||
def has_field_exceptions?
|
||||
self.field_exceptions.present?
|
||||
end
|
||||
|
||||
def self.permitted_params(params)
|
||||
params.require(:id_card_setup).permit(
|
||||
:print_name,
|
||||
|
||||
@@ -2,5 +2,16 @@ class Member < ApplicationRecord
|
||||
belongs_to :id_card_plan, class_name: 'IdCard::Plan', optional: true
|
||||
belongs_to :employer
|
||||
|
||||
def id_card_field_exception_values
|
||||
address = Vhcs::PbEntityAddress.find_by(pb_entity_key: self.pb_entity_key)
|
||||
{
|
||||
zipcode: address.zip,
|
||||
state: address.state,
|
||||
family_id: self.family_id
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
module Vhcs
|
||||
class PbEntityAddress < VhcsRecord
|
||||
|
||||
self.table_name = 'PBEntityAddress'
|
||||
|
||||
alias_attribute :pb_entity_address_key, :PBEntityAddressKey
|
||||
alias_attribute :pb_entity_key, :PBEntityKey
|
||||
alias_attribute :address_type_id, :AddressTypeID
|
||||
alias_attribute :street_line_1, :StreetLine1
|
||||
alias_attribute :street_line_2, :StreetLine2
|
||||
alias_attribute :city, :City
|
||||
alias_attribute :state, :State
|
||||
alias_attribute :zip, :Zip
|
||||
alias_attribute :country_code, :CountryCode
|
||||
alias_attribute :county, :County
|
||||
alias_attribute :override_pb_entity_address_key, :OverridePBEntityAddressKey
|
||||
alias_attribute :when_last_changed, :WhenLastChanged
|
||||
alias_attribute :who_last_changed, :WhoLastChanged
|
||||
alias_attribute :full_address_to_use, :FullAddressToUse
|
||||
alias_attribute :country_sub_div, :CountrySubDiv
|
||||
alias_attribute :full_address, :FullAddress
|
||||
|
||||
def attributes
|
||||
rails_like = {
|
||||
pb_entity_address_key: self.pb_entity_address_key,
|
||||
pb_entity_key: self.pb_entity_key,
|
||||
address_type_id: self.address_type_id,
|
||||
street_line_1: self.street_line_1,
|
||||
street_line_2: self.street_line_2,
|
||||
city: self.city,
|
||||
state: self.state,
|
||||
zip: self.zip,
|
||||
country_code: self.country_code,
|
||||
county: self.county,
|
||||
override_pb_entity_address_key: self.override_pb_entity_address_key,
|
||||
when_last_changed: self.when_last_changed,
|
||||
who_last_changed: self.who_last_changed,
|
||||
full_address_to_use: self.full_address_to_use,
|
||||
country_sub_div: self.country_sub_div,
|
||||
full_address: self.full_address,
|
||||
}
|
||||
super.merge(rails_like)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user