Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass event name and args to #persist_workflow_state #178

Closed

Conversation

glasnoster
Copy link

I'm using the Vestal Versions gem (https://github.com/laserlemon/vestal_versions) to version user changes in models. I also need to version state changes and attach the user that changed the state to the version change.

I have the user available in the event args. This change basically allows me to do the following:

  def persist_workflow_state(new_state, event, *event_args)
    current_user = event_args[0] && event_args[0][:user]
    self.update_attributes(state: new_state, updated_by: current_user)
  end

@glasnoster glasnoster force-pushed the manual_persist_with_event_args branch 2 times, most recently from 7c0cea1 to 6f4874c Compare April 15, 2016 15:12
@glasnoster glasnoster force-pushed the manual_persist_with_event_args branch from 6f4874c to f3bd99f Compare April 15, 2016 15:15
@glasnoster glasnoster closed this Apr 17, 2016
@glasnoster glasnoster reopened this Apr 17, 2016
@geekq geekq closed this Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants