Browse Source

refactor: simplify owning/managing org logic in 23/24 row parser

pull/1334/head
Sam Seed 3 years ago committed by Phil Lee
parent
commit
05faa6efed
  1. 12
      app/services/bulk_upload/lettings/year2023/row_parser.rb

12
app/services/bulk_upload/lettings/year2023/row_parser.rb

@ -899,8 +899,8 @@ private
attributes["la"] = field_25 attributes["la"] = field_25
attributes["postcode_known"] = postcode_known attributes["postcode_known"] = postcode_known
attributes["postcode_full"] = postcode_full attributes["postcode_full"] = postcode_full
attributes["owning_organisation_id"] = owning_organisation_id attributes["owning_organisation"] = owning_organisation
attributes["managing_organisation_id"] = managing_organisation_id attributes["managing_organisation"] = managing_organisation
attributes["renewal"] = renewal attributes["renewal"] = renewal
attributes["scheme"] = scheme attributes["scheme"] = scheme
attributes["location"] = location attributes["location"] = location
@ -1094,18 +1094,10 @@ private
Organisation.find_by_id_on_multiple_fields(field_1) Organisation.find_by_id_on_multiple_fields(field_1)
end end
def owning_organisation_id
owning_organisation&.id
end
def managing_organisation def managing_organisation
Organisation.find_by_id_on_multiple_fields(field_2) Organisation.find_by_id_on_multiple_fields(field_2)
end end
def managing_organisation_id
managing_organisation&.id
end
def renewal def renewal
case field_6 case field_6
when 1 when 1

Loading…
Cancel
Save