Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Previous (or current) and new states the same when calling aasm_event_fired()

#16

When calling the :aasm_event_fired method (when defined), automatically fired by AASM::aasm_fire_event, the previous (or current) and new states seem to always be the same, due to the fact that the call to AASM::set_aasm_current_state_with_persistence changes the value of the :aasm_current_state attribute to the new state prior to the :aasm_event_fired call. Follows a possible (and simple) solution:

http://www.pastie.org/424478

Also, I would like to suggest that the 'persist' parameter be passed along to :aasm_event_fired call, so logging the status change in a separate model might be possible in this method (which wouldn't make sense if persist == false). So the final code might look like:

http://www.pastie.org/424512

Cheers,

Cassiano.

Reported by Cassiano D'Andrea · March 23rd, 2009 @ 01:59 PM

State: new
Milestone: none
Assigned to: Scott Barron Scott Barron

Activity

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.