Make sure Bundle#ends_at is set before validation
otherwise we risk creating overlapping bundles and not catching it.
This commit is contained in:
@@ -15,7 +15,7 @@ class Notification::Bundle < ApplicationRecord
|
||||
)
|
||||
end
|
||||
|
||||
before_create :set_default_window
|
||||
before_validation :set_default_window, if: :new_record?
|
||||
|
||||
validate :validate_no_overlapping
|
||||
|
||||
|
||||
Reference in New Issue
Block a user