diff --git a/app/services/bulk_upload/lettings/row_parser.rb b/app/services/bulk_upload/lettings/row_parser.rb index bcfadd047..ee41f51bd 100644 --- a/app/services/bulk_upload/lettings/row_parser.rb +++ b/app/services/bulk_upload/lettings/row_parser.rb @@ -145,16 +145,6 @@ class BulkUpload::Lettings::RowParser validates :field_97, presence: true validates :field_98, presence: true - def attribute_set - @attribute_set ||= instance_variable_get(:@attributes) - end - - def validate_data_types - unless attribute_set["field_1"].value_before_type_cast&.match?(/\A\d+\z/) - errors.add(:field_1, :invalid) - end - end - def valid? errors.clear @@ -179,6 +169,16 @@ class BulkUpload::Lettings::RowParser private + def attribute_set + @attribute_set ||= instance_variable_get(:@attributes) + end + + def validate_data_types + unless attribute_set["field_1"].value_before_type_cast&.match?(/\A\d+\z/) + errors.add(:field_1, :invalid) + end + end + def postcode_full "#{field_108} #{field_109}" if field_108 && field_109 end