No commit activity in last 3 years
No release in over 3 years
This act gives an Active Record model the ability to act as a finite state machine (FSM).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme
= Acts As State Machine

This act gives an Active Record model the ability to act as a finite state
machine (FSM).

Acquire via subversion at:

http://elitists.textdriven.com/svn/plugins/acts_as_state_machine/trunk

If prompted, use the user/pass anonymous/anonymous.

== Example

 class Order < ActiveRecord::Base
   acts_as_state_machine :initial => :opened

   state :opened
   state :closed, :enter => Proc.new {|o| Mailer.send_notice(o)}
   state :returned

   event :close do
     transitions :to => :closed, :from => :opened
   end

   event :return do
     transitions :to => :returned, :from => :closed
   end
 end

 o = Order.create
 o.close! # notice is sent by mailer
 o.return!