diff --git a/app/services/reminders/update_service.rb b/app/services/reminders/update_service.rb index 795fbacfc427..bc34f4bb75f9 100644 --- a/app/services/reminders/update_service.rb +++ b/app/services/reminders/update_service.rb @@ -31,7 +31,7 @@ class UpdateService < ::BaseServices::Update def after_perform(service_call) reminder = service_call.result - if remind_at_changed?(reminder) + if remind_at_changed? destroy_scheduled_reminder_job(reminder.job_id) if reminder.scheduled? mark_unread_notifications_as_read_for(reminder) if reminder.unread_notifications? @@ -44,10 +44,10 @@ def after_perform(service_call) private - def remind_at_changed?(reminder) + def remind_at_changed? # For some reason reminder.remind_at_changed? returns false # so we assume a change if remind_at is present in the params (would have passed contract validation) - params.key?(:remind_at) && reminder.remind_at.to_i == params[:remind_at].to_i + params[:remind_at].present? end def destroy_scheduled_reminder_job(job_id)