Skip to content
Snippets Groups Projects
Verified Commit 9b24ab41 authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Add better handling for delayed actions

parent 44616ae8
No related branches found
No related tags found
No related merge requests found
......@@ -7,9 +7,23 @@ module Actions
middleware.use Actions::Middleware::KeepCurrentUser
def plan(context = nil, **template_params)
def delay(delay_options, context: nil, **task_params)
task_params = task_params.compact
input.update context: context
input.update task_params: template_params
input.update task_params: task_params
super delay_options, { context: context, task_params: task_params }
end
# Rails passes hashes with keys as string by default
def plan(args = {})
_plan(args.to_options)
end
def _plan(context: nil, **task_params)
input.update context: context
input.update task_params: task_params.compact
plan_self
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment