lib/big_machine.rb in big_machine-1.1.1 vs lib/big_machine.rb in big_machine-1.2.0
- old
+ new
@@ -1,10 +1,10 @@
-require "active_support"
+require "active_support/all"
require "forwardable"
require "big_machine/state"
require "big_machine/active_record"
-require "big_machine/transition_methods"
+require "big_machine/available_methods"
require "big_machine/lock"
module BigMachine
extend ActiveSupport::Concern
@@ -32,11 +32,11 @@
@initial_state_class
end
def set_initial_state_class
@initial_state_class = self.initial_state.to_s.camelize.constantize
- include ::BigMachine::TransitionMethods
+ include ::BigMachine::AvailableMethods
end
end
def current_state
set_current_state(self.class.initial_state_class) unless @current_state
@@ -50,10 +50,10 @@
forward_current_state
end
def forward_current_state
extend SingleForwardable
- def_delegators :current_state, *current_state.class.transition_methods
+ def_delegators :current_state, *current_state.class.available_methods
end
def transition_to(next_state_class, *args, &block)
return unless current_state.exit *args