diff --git a/modules/vye/lib/concerns/vye/cloud_transfer.rb b/modules/vye/lib/concerns/vye/cloud_transfer.rb index 776daa199b7..69df16ebc78 100644 --- a/modules/vye/lib/concerns/vye/cloud_transfer.rb +++ b/modules/vye/lib/concerns/vye/cloud_transfer.rb @@ -155,7 +155,10 @@ def remove_aws_files_from_s3_buckets def delete_inactive_bdns bdn_clone_ids = Vye::BdnClone.where(is_active: nil, export_ready: nil).pluck(:id) bdn_clone_ids.each do |bdn_clone_id| - Rails.logger.info("Vye::SundownSweep::ClearDeactivatedBdns#delete_inactive_bdns: processing BdnClone(#{bdn_clone_id})") + Rails.logger.info( + "Vye::SundownSweep::ClearDeactivatedBdns#delete_inactive_bdns: processing BdnClone(#{bdn_clone_id})" + ) + Rails.logger.info('Vye::SundownSweep::ClearDeactivatedBdns#delete_inactive_bdns: deleting DirectDepositChanges') Vye::DirectDepositChange.joins(:user_info).where(vye_user_infos: { bdn_clone_id: }).in_batches.delete_all Rails.logger.info('Vye::SundownSweep::ClearDeactivatedBdns#delete_inactive_bdns: deleting AddressChanges') @@ -165,7 +168,10 @@ def delete_inactive_bdns # We're not worried about validations here because it wouldn't be in the table if it wasn't valid # rubocop:disable Rails/SkipsModelValidations - Rails.logger.info('Vye::SundownSweep::ClearDeactivatedBdns#delete_inactive_bdns: nullifying verification references') + Rails.logger.info( + 'Vye::SundownSweep::ClearDeactivatedBdns#delete_inactive_bdns: nullifying verification references' + ) + Vye::Verification .joins(:user_info) .where(vye_user_infos: { bdn_clone_id: }) diff --git a/modules/vye/lib/tasks/vye/setup_for_sundown_sweep_devtest.rake b/modules/vye/lib/tasks/vye/setup_for_sundown_sweep_devtest.rake index ff4ac9ebfcb..e5a3a4a9d5e 100644 --- a/modules/vye/lib/tasks/vye/setup_for_sundown_sweep_devtest.rake +++ b/modules/vye/lib/tasks/vye/setup_for_sundown_sweep_devtest.rake @@ -32,36 +32,38 @@ namespace :vye do Vye.settings.scrypt.salt = '1' puts 'Creating BdnClone row that will be deleted' - FactoryBot.create(:vye_bdn_clone_with_user_info_children, transact_date: Date.today - 2.days) + FactoryBot.create(:vye_bdn_clone_with_user_info_children, transact_date: Time.Zone.today - 2.days) puts 'Creating active BdnClone row' - FactoryBot.create(:vye_bdn_clone_with_user_info_children, :active, transact_date: Date.today - 1.days) + FactoryBot.create( + :vye_bdn_clone_with_user_info_children, :active, transact_date: Time.Zone.today - 1.day + ) puts 'Creating freshly imported BdnClone row' FactoryBot.create(:vye_bdn_clone_with_user_info_children, is_active: false) puts 'BdnClones created' - Vye::BdnClone.all.each { |bdn_clone| puts bdn_clone.inspect } + Vye::BdnClone.all.find_each { |bdn_clone| puts bdn_clone.inspect } puts "\nUserProfiles created" - Vye::UserProfile.all.each { |user_profile| puts user_profile.inspect } + Vye::UserProfile.all.find_each { |user_profile| puts user_profile.inspect } puts "\nUserInfos created" - Vye::UserInfo.all.each { |user_info| puts user_info.inspect } + Vye::UserInfo.all.find_each { |user_info| puts user_info.inspect } puts "\nPendingDocuments created" - Vye::PendingDocument.all.each { |pending_document| puts pending_document.inspect } + Vye::PendingDocument.all.find_each { |pending_document| puts pending_document.inspect } puts "\nVerifications created" - Vye::Verification.all.each { |verification| puts verification.inspect } + Vye::Verification.all.find_each { |verification| puts verification.inspect } puts "\nAddressChanges created" - Vye::AddressChange.all.each { |address_change| puts address_change.inspect } + Vye::AddressChange.all.find_each { |address_change| puts address_change.inspect } puts "\nAwards created" - Vye::Award.all.each { |award| puts award.inspect } + Vye::Award.all.find_each { |award| puts award.inspect } puts "\nDirectDepositChanges created" - Vye::DirectDepositChange.all.each { |direct_deposit_change| puts direct_deposit_change.inspect } + Vye::DirectDepositChange.all.find_each { |direct_deposit_change| puts direct_deposit_change.inspect } end end diff --git a/modules/vye/spec/sidekiq/vye/midnight_run_spec.rb b/modules/vye/spec/sidekiq/vye/midnight_run_spec.rb index 271bafd39b3..7021d9f8210 100644 --- a/modules/vye/spec/sidekiq/vye/midnight_run_spec.rb +++ b/modules/vye/spec/sidekiq/vye/midnight_run_spec.rb @@ -31,7 +31,7 @@ # In the RSpec test environment, the job isn't executed unless you explicitly call perform or # configure Sidekiq for inline execution during the test. # - # If you want to test perform_async directly in the future, you can configure Sidekiq to execute + # If you want to test perform_async directly in the future, you can configure Sidekiq to execute # jobs immediately in your test setup. Add the following to your spec_helper.rb or rails_helper.rb: # require 'sidekiq/testing' # Sidekiq::Testing.inline!