diff --git a/app/models/bulk_upload.rb b/app/models/bulk_upload.rb index 11aba046e..f546ea56d 100644 --- a/app/models/bulk_upload.rb +++ b/app/models/bulk_upload.rb @@ -59,6 +59,8 @@ class BulkUpload tenancy: row[9], tenancyother: row[10], # tenancyduration: row[11], + other_hhmemb: other_hhmemb(row), + hhmemb: other_hhmemb(row) + 1, age1: row[12], age2: row[13], age3: row[14], @@ -190,4 +192,8 @@ class BulkUpload gdpr_declined: 0, } end + + def other_hhmemb(row) + [13, 14, 15, 16, 17, 18, 19].count { |idx| row[idx].present? } + end end diff --git a/app/models/case_log.rb b/app/models/case_log.rb index 718e3fda2..1b86b19de 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -39,7 +39,6 @@ class CaseLog < ApplicationRecord include SoftValidations include DbEnums default_scope -> { kept } - scope :not_completed, -> { where.not(status: "completed") } validates_with CaseLogValidator before_save :update_status! diff --git a/db/schema.rb b/db/schema.rb index 1ef990508..614c895c2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -122,6 +122,8 @@ ActiveRecord::Schema.define(version: 2021_11_12_105348) do t.integer "rp_dontknow" t.datetime "discarded_at" t.string "tenancyother" + t.integer "override_net_income_validation" + t.string "net_income_known" t.string "gdpr_acceptance" t.string "gdpr_declined" t.string "property_owner_organisation" @@ -133,8 +135,6 @@ ActiveRecord::Schema.define(version: 2021_11_12_105348) do t.string "needs_type" t.string "sale_completion_date" t.string "purchaser_code" - t.integer "override_net_income_validation" - t.string "net_income_known" t.integer "reason" t.string "propcode" t.integer "majorrepairs"