From 0126aed6d73bcf11c8f6af80616ca1ddbc2513e1 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Tue, 26 Aug 2025 16:59:01 +0200 Subject: [PATCH] Make sure they don't overlap on creation --- app/models/notification/bundle.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/notification/bundle.rb b/app/models/notification/bundle.rb index 306b9083f..592e77411 100644 --- a/app/models/notification/bundle.rb +++ b/app/models/notification/bundle.rb @@ -4,7 +4,7 @@ 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 :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 <= ?)",