From f3d709f6c84660f8396752c69da66ad7e9e9ed4d Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Fri, 1 Nov 2024 09:49:44 +0000 Subject: [PATCH] Add paper_trail to bulk upload objects (#2745) --- app/models/bulk_upload.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/bulk_upload.rb b/app/models/bulk_upload.rb index 93f6612253..a0ed265c99 100644 --- a/app/models/bulk_upload.rb +++ b/app/models/bulk_upload.rb @@ -32,6 +32,8 @@ class BulkUpload < ApplicationRecord scope :filter_by_user, ->(user_id, _user = nil) { user_id.present? ? where(user_id:) : all } scope :filter_by_uploading_organisation, ->(organisation_id, _user = nil) { where(organisation_id:) } + has_paper_trail + def completed? incomplete_logs = logs.where.not(status: "completed") !incomplete_logs.exists?