From d99a835184605cae30ae0675cf43c634992bdb07 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Tue, 26 Aug 2025 17:41:04 +0200 Subject: [PATCH] Format --- app/models/notification/bundle.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/notification/bundle.rb b/app/models/notification/bundle.rb index 6ec294996..2a5e9ed79 100644 --- a/app/models/notification/bundle.rb +++ b/app/models/notification/bundle.rb @@ -5,14 +5,14 @@ class Notification::Bundle < ApplicationRecord scope :due, -> { pending.where("ends_at <= ?", Time.current) } scope :containing, ->(notification) { where("starts_at <= ? AND ends_at > ?", notification.created_at, notification.created_at) } - scope :overlapping_with, ->(other_bundle) { + scope :overlapping_with, ->(other_bundle) do where( "(starts_at <= ? AND ends_at >= ?) OR (starts_at <= ? AND ends_at >= ?) OR (starts_at >= ? AND ends_at <= ?)", other_bundle.starts_at, other_bundle.starts_at, other_bundle.ends_at, other_bundle.ends_at, other_bundle.starts_at, other_bundle.ends_at ) - } + end before_create :set_default_window