From 80bbce2fd7129ba057882a9845cac7acb27340ac Mon Sep 17 00:00:00 2001 From: Arthur Campbell Date: Fri, 30 Jun 2023 16:38:12 +0100 Subject: [PATCH] create rake task to set correct creation method values for existing logs --- lib/tasks/creation_method.rake | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 lib/tasks/creation_method.rake diff --git a/lib/tasks/creation_method.rake b/lib/tasks/creation_method.rake new file mode 100644 index 000000000..a7ce1c960 --- /dev/null +++ b/lib/tasks/creation_method.rake @@ -0,0 +1,5 @@ +desc "set creation method to bulk upload if a log has a bulk upload id" +task set_creation_method: :environment do + LettingsLog.where.not(bulk_upload_id: nil).update_all(creation_method: "bulk upload") + SalesLog.where.not(bulk_upload_id: nil).update_all(creation_method: "bulk upload") +end \ No newline at end of file