From a0ca8569e1101a667311f7af3eaf139ecd5492d3 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Mon, 6 Feb 2023 12:55:50 +0000 Subject: [PATCH] use ActiveModel::Errors api correctly - as opposed to calling methods manually --- app/services/bulk_upload/lettings/row_parser.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/services/bulk_upload/lettings/row_parser.rb b/app/services/bulk_upload/lettings/row_parser.rb index e63bba268..ef6974e4c 100644 --- a/app/services/bulk_upload/lettings/row_parser.rb +++ b/app/services/bulk_upload/lettings/row_parser.rb @@ -143,15 +143,15 @@ class BulkUpload::Lettings::RowParser inclusion: { in: (1..12).to_a, message: I18n.t("validations.invalid_option", question: "letting type") } validates :field_4, presence: { if: proc { [2, 4, 6, 8, 10, 12].include?(field_1) } } + validate :validate_data_types + validate :validate_nulls + validate :validate_relevant_collection_window + def valid? errors.clear super - validate_data_types - validate_nulls - validate_relevant_collection_window - log.valid? log.errors.each do |error|