From 16c560434b0cc44af0b8455830022920570d4bdb Mon Sep 17 00:00:00 2001 From: Richard Lynch Date: Tue, 22 Oct 2024 11:02:05 +0100 Subject: [PATCH] DROP THIS --- .../claim/claims_preventing_payment_finder.rb | 2 +- db/seeds.rb | 21 ++++++++++++++++++- spec/factories/schools.rb | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app/models/claim/claims_preventing_payment_finder.rb b/app/models/claim/claims_preventing_payment_finder.rb index 716c1b9092..1668d5de31 100644 --- a/app/models/claim/claims_preventing_payment_finder.rb +++ b/app/models/claim/claims_preventing_payment_finder.rb @@ -16,7 +16,7 @@ def initialize(claim) # provided by `claim`, and hence `claim` cannot be paid in the same payment # as the returned claims. def claims_preventing_payment - @claims_preventing_payment ||= find_claims_preventing_payment + [] end private diff --git a/db/seeds.rb b/db/seeds.rb index a31537c92d..89f4bb9851 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,3 +1,5 @@ +require "faker" +require Rails.application.root.join("lib", "factory_helpers") # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). # @@ -27,7 +29,24 @@ AcademicYear.current ).run - SchoolDataImporterJob.perform_later if School.count < 100 + SchoolDataImporterJob.perform_now if School.count < 100 + + PayrollRun.destroy_all + + FactoryHelpers.create_factory_registry + FactoryHelpers.reset_factory_registry + + FactoryBot.create( + :payroll_run, + claims_counts: { + Policies::StudentLoans => 600, + Policies::EarlyCareerPayments => 900, + [Policies::EarlyCareerPayments, Policies::StudentLoans] => 300, + Policies::FurtherEducationPayments => 600, + Policies::InternationalRelocationPayments => 300, + Policies::LevellingUpPremiumPayments => 301 + } + ) end if Rails.env.development? diff --git a/spec/factories/schools.rb b/spec/factories/schools.rb index 344453c3fb..06a54c3a82 100644 --- a/spec/factories/schools.rb +++ b/spec/factories/schools.rb @@ -4,7 +4,7 @@ journey { nil } end - sequence(:urn) + sequence(:urn) { |n| School.maximum(:urn).to_i + n } name { "#{Faker::Company.unique.name} School" } school_type { :community_school } school_type_group { :la_maintained }