Production Build Working
This commit is contained in:
@@ -6,7 +6,7 @@ module Baclight
|
||||
belongs_to :baclight_employer, class_name: "Baclight::Employer", foreign_key: "employer_id"
|
||||
|
||||
scope :active, -> {
|
||||
where(active: true)
|
||||
where(active: true)
|
||||
}
|
||||
|
||||
# alias_attribute :id, :id
|
||||
@@ -40,5 +40,19 @@ module Baclight
|
||||
baclight_employer&.baclight_broker&.carrier_id
|
||||
end
|
||||
|
||||
def eff_date
|
||||
participation = Vhcs::PbProductParticipation.joins('INNER JOIN "PBCoveredEntities" ON "PBProductParticipation"."PBProductParticipationKey" = "PBCoveredEntities"."PBProductParticipationKey"').where('"PBCoveredEntities"."PBEntityKey" = ?', pb_entity_key).order(out_of_effect: :desc).first
|
||||
eff_date = nil
|
||||
if participation
|
||||
in_effect = participation.in_effect
|
||||
out_of_effect = participation.out_of_effect
|
||||
|
||||
if in_effect <= (Date.today + 90.days) && (out_of_effect - 1.day) > Date.today && out_of_effect > in_effect
|
||||
eff_date = in_effect.strftime("%m/%d/%Y")
|
||||
end
|
||||
end
|
||||
eff_date
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user