1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
Commit graph

26 commits

Author SHA1 Message Date
Scott Barron
7dbbc1480b Add StateMachine object and StateMachineFactory
Supports initial state in SM
2008-05-31 15:27:15 -07:00
Scott Barron
28fd460950 Move state for select logic into State 2008-05-31 15:11:18 -07:00
Scott Barron
3ccbeaca88 Support enter and exit actions on states 2008-05-31 15:08:12 -07:00
Scott Barron
2bb30ee84b Combine event firing logic for ! (persistent) and non-! (non-persistent) event triggers 2008-05-31 14:39:25 -07:00
Scott Barron
d3c49b6e72 Use State objects 2008-05-31 14:33:45 -07:00
Chad Humphries
34444b7632 Corrected aasm_states_for_select to return state as string for option value. 2008-05-29 07:05:50 -07:00
Edgecase Pair One
fc86784602 Added success callback which takes place after persistent aasm writes 2008-05-20 15:27:35 -04:00
Jeff Dean
cb6bd4f534 * Specs and bug fixes for the ActiveRecordPersistence, keeping persistence columns in sync
Allowing for nil values in states for active record
  New non-(!) methods that allow for firing events without persisting [Jeff Dean]
2008-04-29 01:27:56 -04:00
Chad Humphries
bd788a5212 Added aasm_states_for_select that will return a select friendly collection of states.
Also added additional tests
2008-04-14 15:57:34 -04:00
Scott Barron
61b6b8ec06 Add two event callbacks:
aasm_event_fired(from, to) - called when an event is fired successfully
aasm_event_failed(event)   - called when an event fails

These could be used to implement transition logging [Artem Vasiliev] or
setting a timestamp column [Mike Ferrier] as well as other pieces of love and magic.
2008-03-02 07:52:46 -05:00
Scott Barron
32156165d4 Add aasm_events_for_state and aasm_events_for_current_state [Joao Paulo Lins] 2008-02-28 08:33:40 -05:00
Scott Barron
ebb36e697d Some automatic persistence hooks for ActiveRecord objects 2008-02-22 15:46:31 -05:00
Scott Barron
ea7820db4a More consistent aasm_ namespacing 2008-02-21 12:59:28 -05:00
Scott Barron
551503d12f Add .aasm_states method to get a list of all states for a class 2008-02-21 12:54:42 -05:00
Scott Barron
8fc83db605 Further set up for functional tests 2008-02-21 12:32:04 -05:00
Scott Barron
a68200556e Make #event! methods return a boolean [Joel Chippindale] 2008-02-21 12:11:25 -05:00
Scott Barron
03780617a1 Pass the state into aasm_write_state 2008-02-21 11:15:40 -05:00
Scott Barron
91794f70fe rename aasm_persist to aasm_write_state
add aasm_read_state to complete persistence
2008-02-21 11:08:55 -05:00
Scott Barron
8c02c47160 Bring in transition guards 2008-02-21 10:46:06 -05:00
Scott Barron
b4c69afcf2 A basic, functioning state machine working for regular ruby objects
Started persistence hook
Complete spec coverage
2008-02-21 10:16:08 -05:00
Scott Barron
342984a3eb move .events to .aasm_events 2008-01-08 10:03:18 -05:00
Scott Barron
7aae9e432d don't expose #events 2008-01-08 09:58:02 -05:00
Scott Barron
4fd58db233 aasm_after_update -> aasm_persist 2008-01-08 09:41:52 -05:00
Scott Barron
8697e97b7d current_state -> aasm_current_state 2008-01-08 09:39:00 -05:00
Scott Barron
053e9c7eee Strip down to a very basic state machine with transitions 2008-01-07 15:07:38 -05:00
Scott Barron
f6a8a34f06 Import into git 2008-01-07 14:11:38 -05:00