From bf63df7d4a935a3d787aa01dc9748c87a529a378 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Tue, 26 Aug 2025 17:02:51 +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 592e77411..6ec294996 100644 --- a/app/models/notification/bundle.rb +++ b/app/models/notification/bundle.rb @@ -4,8 +4,8 @@ class Notification::Bundle < ApplicationRecord enum :status, %i[ pending processing delivered ] 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 :containing, ->(notification) { where("starts_at <= ? AND ends_at > ?", notification.created_at, notification.created_at) } + scope :overlapping_with, ->(other_bundle) { 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,