Need another lifecycle callback for _before_ the transition happens
Reported by Betelgeuse | July 29th, 2009 @ 08:16 AM | in Beyond Hobo 1.0
If you have a transition that sends an email and throws an exception when it fails and as such wasn't sent, I would like the state not the changed. Now when I try sending it again it fails as the state has already been changed to the next state and it the send transition can't be run:
undefined method `run!' for nil:NilClass
/home/slugs/17660_901446c_d6ee/mnt/.gems/gems/hobo-0.8.8/lib/hobo/lifecycles/lifecycle.rb:129:in `transition'
(eval):3:in `send_email!'
/disk1/home/slugs/17660_901446c_d6ee/mnt/app/models/result.rb:28:in `send_email'
/home/slugs/17660_901446c_d6ee/mnt/.gems/gems/betelgeuse-delayed_job-1.8.0/lib/delayed/performable_method.rb:23:in `send'
/home/slugs/17660_901446c_d6ee/mnt/.gems/gems/betelgeuse-delayed_job-1.8.0/lib/delayed/performable_method.rb:23:in `perform'
/home/slugs/17660_901446c_d6ee/mnt/.gems/gems/betelgeuse-delayed_job-1.8.0/lib/delayed/job.rb:216:in `invoke_job'
Comments and changes to this ticket
-
Tom Locke October 24th, 2009 @ 06:03 PM
- State changed from new to open
- Milestone set to Beyond Hobo 1.0
Yeah this is a known limitation of the current design. We should have separate before and after callbacks
-
Tom Locke October 24th, 2009 @ 06:03 PM
- Title changed from Ability to change lifecycle state only when block has been succesfully run to Need another lifecycle callback for _before_ the transition happens
-
Bryan Larsen October 29th, 2009 @ 11:16 PM
- Tag changed from lifecycles to enhancement, lifecycles
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป