FIX: resets pending automations only if necessary (#26685)

Prior to this fix, any change to an automation would reset `pending_automations`, now we only do it if any value related to recurrence (start_date, interval, frequency, execute_at...) has been changed.

It means that any trigger creating `pending_automations` now needs to manage them in the `on_update` callback.
This commit is contained in:
Joffrey JAFFEUX
2024-04-19 14:23:57 +02:00
committed by GitHub
parent 5021f8a7da
commit bf715c8235
5 changed files with 152 additions and 15 deletions

View File

@ -162,7 +162,6 @@ module DiscourseAutomation
end
def reset!
pending_automations.delete_all
pending_pms.delete_all
scriptable&.on_reset&.call(self)
end