Forum: Ruby on Rails aasm callback order?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Danimal (Guest)
on 2008-10-28 02:31
(Received via mailing list)
Hello!

Sometime ago I ran across a webpage where someone had identified the
full callback sequence for an object lifecycle including AASM with
it's :enter and :exit and whatnot callbacks. Unfortunately, I can't
find it and searches don't seem to help.

Does anyone have a reference to a page that shows the callback
sequence with Acts As State Machine (the gem)?

I think there was a Wiki page on github with this, but I can't find
it. Grrr.

Thanks!

-Danimal
Robert Z. (Guest)
on 2008-10-28 02:43
(Received via mailing list)
Danimal,

Usually the best place to look is the actual source itself.
http://github.com/omghax/acts_as_state_machine/tre...

Looks like this is what you are looking for
:entering
:entered
:exited

The entering and exiting methods call the @enter and @exit options
respectively which are passed in during instantiation.

Cheers

--
Robert Z.
Zapient, LLC
Ruby on Rails Development and Consulting

http://www.zapient.com
http://www.fromjavatoruby.com
Danimal (Guest)
on 2008-10-28 02:48
(Received via mailing list)
Robert,

I appreciate the fast response. Actually, though, there was a page
somewhere that showed the FULL lifecycle of a ruby model that goes
through before_save, validation, after_save, and all that along with
the AASM transitions when the bang (!) character is included and when
enters, exits, guards, transitions and such are used.

I can practically visualize the page I remember... it was a listing of
the order of each of these "steps" (callbacks and such).

In other words, it was very similar to the first part of this:
http://api.rubyonrails.org/classes/ActiveRecord/Ca...
but with the AASM hooks included.

It's just bugging me because I thought I bookmarked the page and I
can't find my bookmark. *sigh*

-Danimal
Robert Z. (Guest)
on 2008-10-28 02:52
(Received via mailing list)
Ahhh I see. Sorry, Im not familiar with that wiki you are talking
about. However I can solve your bookmarking problem if you happen to
use Firefox http://www.foxmarks.com/  :)

Good luck finding that wiki.
--
Robert Z.
Zapient, LLC
Ruby on Rails Development and Consulting

http://www.zapient.com
http://www.fromjavatoruby.com
Danimal (Guest)
on 2008-10-28 02:56
(Received via mailing list)
Thank you, Robert! I'll have to try out foxmarks. I suspect that the
problem was PEBKAC... i.e. I probably thought "that's a cool page, I
should bookmark it" and for whatever reason did not. Heh.

Anyway... anyone else have an inkling about the page/wiki that I'm
talking about? Or was it just in a dream?

:-)

-Danimal
dusty (Guest)
on 2008-12-01 21:28
(Received via mailing list)
Dan Sharp (Guest)
on 2008-12-02 06:54
(Received via mailing list)
Dusty,

That may very well be it. I thought it was a longer list, but maybe
I'm just remembering the two lists (new vs. existing) and somehow
lumping them together.

Thanks for the reference, though! :-)

-Danimal
Teedub (Guest)
on 2008-12-02 16:14
(Received via mailing list)
This topic is locked and can not be replied to.