From 5a1b614a4951e17a824ae887ba6b96e103333460 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Wed, 25 Sep 2024 12:05:10 +0100 Subject: [PATCH] Remove unused status enum and add failed enum --- app/models/bulk_upload.rb | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/app/models/bulk_upload.rb b/app/models/bulk_upload.rb index e437fc2b6..cc3d30bfb 100644 --- a/app/models/bulk_upload.rb +++ b/app/models/bulk_upload.rb @@ -1,17 +1,7 @@ class BulkUpload < ApplicationRecord enum log_type: { lettings: "lettings", sales: "sales" } enum rent_type_fix_status: { not_applied: "not_applied", applied: "applied", not_needed: "not_needed" } - - enum status: { - logs_uploaded_no_errors: 0, - blank_template: 1, - wrong_template: 2, - important_errors: 3, - critical_errors: 4, - potential_errors: 5, - logs_uploaded_with_errors: 6, - errors_fixed_in_service: 7, - } + enum failed: { blank_template: 1, wrong_template: 2 } belongs_to :user @@ -52,8 +42,8 @@ class BulkUpload < ApplicationRecord end def status - return :blank_template if failed == 1 - return :wrong_template if failed == 2 + return :blank_template if failed == "blank_template" + return :wrong_template if failed == "wrong_template" return :logs_uploaded_no_errors if bulk_upload_errors.none? if logs.visible.exists?