From efbd47e7d151da17a4107e0188bad01dd8de6e7e Mon Sep 17 00:00:00 2001 From: Vanson Samuel <37637+binq@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:50:21 -0500 Subject: [PATCH] ingress awards also --- modules/vye/app/models/vye/award.rb | 13 +++++++------ modules/vye/lib/vye/batch_transfer/ingress_files.rb | 4 +++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/vye/app/models/vye/award.rb b/modules/vye/app/models/vye/award.rb index 09682f9cc11..f37db8962a3 100644 --- a/modules/vye/app/models/vye/award.rb +++ b/modules/vye/app/models/vye/award.rb @@ -6,11 +6,12 @@ class Vye::Award < ApplicationRecord enum cur_award_ind: { current: 'C', future: 'F', past: 'P' } - REQUIRED_ATTRIBUTES = %i[ - award_begin_date award_end_date begin_rsn cur_award_ind end_rsn - monthly_rate number_hours payment_date training_time type_hours type_training - ].freeze - - validates(*REQUIRED_ATTRIBUTES, presence: true) + validates( + *%i[ + award_end_date cur_award_ind end_rsn + monthly_rate number_hours payment_date training_time + ].freeze, + presence: true + ) end end diff --git a/modules/vye/lib/vye/batch_transfer/ingress_files.rb b/modules/vye/lib/vye/batch_transfer/ingress_files.rb index 2c0ffa6fc0b..a744822b31f 100644 --- a/modules/vye/lib/vye/batch_transfer/ingress_files.rb +++ b/modules/vye/lib/vye/batch_transfer/ingress_files.rb @@ -18,7 +18,9 @@ def bdn_import(data) profile = Vye::UserProfile.build(parsed.attributes[:profile]) info = profile.user_infos.build(parsed.attributes[:info]) info.address_changes.build({ origin: 'backend' }.merge(parsed.attributes[:address])) - + parsed.attributes[:awards].each do |award| + info.awards.build(award) + end profile.save! end end