Skip to content

Instantly share code, notes, and snippets.

@madzhuga
Created November 3, 2017 05:21
Show Gist options
  • Save madzhuga/29865d6b08361d66f5d470836aa086ec to your computer and use it in GitHub Desktop.
Save madzhuga/29865d6b08361d66f5d470836aa086ec 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')
RailsWorkflow::ProcessManager.start_process(
template.id,
{ user: self, url_path: 'user_path', url_params: self }
)
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment