From 22a3d61f4a07ac8571410567ae30605cd4db83a1 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Thu, 5 Mar 2026 11:12:38 +0000 Subject: [PATCH] CLDC-4226: add todo comment --- app/models/log.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/log.rb b/app/models/log.rb index 7ba241f6d..52c7bca5d 100644 --- a/app/models/log.rb +++ b/app/models/log.rb @@ -50,6 +50,7 @@ class Log < ApplicationRecord scope :has_old_form_id, -> { where.not(old_form_id: nil) } scope :imported_2023_with_old_form_id, -> { imported.filter_by_year(2023).has_old_form_id } scope :imported_2023, -> { imported.filter_by_year(2023) } + # TODO: CLDC-4273: use .union in filter_by_organisation rather than raw SQL scope :filter_by_organisation, lambda { |orgs, _user = nil| owned = unscoped.where(owning_organisation: orgs).select(:id) managed = unscoped.where(managing_organisation: orgs).select(:id)