Skip to content

Instantly share code, notes, and snippets.

@madzhuga
Created November 9, 2017 05:56
Show Gist options
  • Select an option

  • Save madzhuga/8c917fcb46eb7755a04e5f6c5def0ec9 to your computer and use it in GitHub Desktop.

Select an option

Save madzhuga/8c917fcb46eb7755a04e5f6c5def0ec9 to your computer and use it in GitHub Desktop.
class User < ApplicationRecord
...
after_create :start_newcomer_process
def start_newcomer_process
template = RailsWorkflow::ProcessTemplate.find_by_title('New User Process')
# we using current_operation_path to navigate to a new endpoint
# when user picks up operation
RailsWorkflow::ProcessManager.start_process(
template.id,
{ user: self, url_path: 'current_operation_path', url_params: self }
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment