diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-08-04 11:03:57 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-08-04 11:03:57 -0500 |
commit | aad5a30bf25d8a3167afd685fc91c99f4f09cc57 (patch) | |
tree | f700750ee088e483537fa7ee992a109b834b1ddc /activemodel/lib/active_model/state_machine/event.rb | |
parent | 55d1d12c32a1b99f3f07d2346b49a63650ba2e9d (diff) | |
download | rails-aad5a30bf25d8a3167afd685fc91c99f4f09cc57.tar.gz rails-aad5a30bf25d8a3167afd685fc91c99f4f09cc57.tar.bz2 rails-aad5a30bf25d8a3167afd685fc91c99f4f09cc57.zip |
Add simple support for ActiveModel's StateMachine for ActiveRecord
Diffstat (limited to 'activemodel/lib/active_model/state_machine/event.rb')
-rw-r--r-- | activemodel/lib/active_model/state_machine/event.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/activemodel/lib/active_model/state_machine/event.rb b/activemodel/lib/active_model/state_machine/event.rb index 3eb656b6d6..30e9601dc2 100644 --- a/activemodel/lib/active_model/state_machine/event.rb +++ b/activemodel/lib/active_model/state_machine/event.rb @@ -1,5 +1,3 @@ -require 'active_model/state_machine/state_transition' - module ActiveModel module StateMachine class Event @@ -53,12 +51,12 @@ module ActiveModel self end - private - def transitions(trans_opts) - Array(trans_opts[:from]).each do |s| - @transitions << StateTransition.new(trans_opts.merge({:from => s.to_sym})) + private + def transitions(trans_opts) + Array(trans_opts[:from]).each do |s| + @transitions << StateTransition.new(trans_opts.merge({:from => s.to_sym})) + end end - end end end end |