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

Event triggers state update but not invokes method #82

Closed
tomraulet opened this issue May 29, 2013 · 2 comments
Closed

Event triggers state update but not invokes method #82

tomraulet opened this issue May 29, 2013 · 2 comments

Comments

@tomraulet
Copy link

Using workflow in an ActiveRecord model, when an event is raised the workflow state is updated, however the method model (with the same name) is not invoked.

I use RVM with ruby-1.9.2-p320 and rails 3.2.12.

My model :

class Assembly < ActiveRecord::Base
include Workflow
...
workflow do
state :fresh_aln_assembly do
event :submit_aln_transcripts_on_dataset, :transitions_to => :aln_transcripts_on_dataset
end
state :aln_transcripts_on_dataset do
event :aln_transcripts_on_dataset_check, :transitions_to => :aln_transcripts_on_dataset_checking
end
etc...
...
def aln_transcripts_on_dataset
do some stuff
end
...

@dwbutler
Copy link

The method needs to be named the same as your triggering event, not the same as your state.

@tomraulet
Copy link
Author

Ok !
I misunderstood readme doc ! Sorry!

Thank you very much ;)

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

No branches or pull requests

2 participants