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

Throw out callbacks... #163

Closed
troessner opened this issue Feb 23, 2016 · 5 comments
Closed

Throw out callbacks... #163

troessner opened this issue Feb 23, 2016 · 5 comments
Labels

Comments

@troessner
Copy link
Owner

....because we have way to many. The goal would be to make transitions lean again.

The following callbacks:

  • enter
  • event_fired
  • on_transition

should go away.

@itkin
Copy link

itkin commented Apr 6, 2016

on_transition is my favorite, please mercy ;-).

Useful to build associated model instances after guards have run but before the owner model is saved.

@troessner
Copy link
Owner Author

Useful to build associated model instances after guards have run but before the owner model is saved.

Thanks for the feedback - I'll take that into account, promised.
What do you think about "enter" and "event_fired"?

@itkin
Copy link

itkin commented Apr 8, 2016

never used enter, using event_fired to easily catch the current event on each transition.

For example if an instance is versioned with papertrail, you can override the version name doing something like that :

def event_fired(current_state, new_state, event)
  self.paper_trail_event = event.name
end

... leading to have versions named : 'create', 'activate', 'unactivate', (instead of 'create', 'update', 'update')

Generally speaking i think i would keep callbacks :-)

@duskhacker
Copy link

duskhacker commented Apr 2, 2019

We have complicated states to keep track of, and we use all those events, removing them would force us to change things that we don't want to change, as they are hard to develop and test because of the external resources involved. Probably would have to drop Transitions or fork it.

Sorry, just noticed this is 3 year old issue.

@troessner
Copy link
Owner Author

troessner commented Apr 2, 2019

@duskhacker yep ;)
I'm not actively developing features for this gem anymore (only bugfixes / dependency and version updates) so the chances that we're throwing those callbacks out are zero. I also respect your needs as a user so the change as I initially had thought about it wouldn't happen anyways. Closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants