|
|
|
@ -1,5 +1,6 @@ |
|
|
|
class BulkUpload::Lettings::Validator |
|
|
|
class BulkUpload::Lettings::Validator |
|
|
|
include ActiveModel::Validations |
|
|
|
include ActiveModel::Validations |
|
|
|
|
|
|
|
include Rails.application.routes.url_helpers |
|
|
|
|
|
|
|
|
|
|
|
attr_reader :bulk_upload, :path |
|
|
|
attr_reader :bulk_upload, :path |
|
|
|
|
|
|
|
|
|
|
|
@ -180,7 +181,7 @@ private |
|
|
|
return if halt_validations? |
|
|
|
return if halt_validations? |
|
|
|
|
|
|
|
|
|
|
|
if csv_parser.missing_required_headers? |
|
|
|
if csv_parser.missing_required_headers? |
|
|
|
errors.add :base, I18n.t("activemodel.errors.models.bulk_upload/lettings/validator.attributes.base.no_headers", guidance_link: "https://#{ENV['APP_HOST']}/lettings-logs/bulk-upload-logs/guidance?form%5Byear%5D=#{bulk_upload.year}#using-the-bulk-upload-template") |
|
|
|
errors.add :base, I18n.t("activemodel.errors.models.bulk_upload/lettings/validator.attributes.base.no_headers", guidance_link: bulk_upload_lettings_log_url(id: "guidance", form: { year: bulk_upload.year }, host: ENV["APP_HOST"], anchor: "using-the-bulk-upload-template")) |
|
|
|
halt_validations! |
|
|
|
halt_validations! |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|