Browse Source

Set hhemb

pull/84/head
baarkerlounger 4 years ago
parent
commit
7348178810
  1. 6
      app/models/bulk_upload.rb
  2. 1
      app/models/case_log.rb
  3. 4
      db/schema.rb

6
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

1
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!

4
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"

Loading…
Cancel
Save