def define_action_helpers(action_hook = self.action)
action = self.action
private_method = owner_class.private_method_defined?(action_hook)
if (owner_class.method_defined?(action_hook) || private_method) && !owner_class.state_machines.any? {|name, machine| machine.action == action && machine != self}
@instance_helper_module.class_eval do
define_method(action_hook) do |*args|
self.class.state_machines.fire_event_attributes(self, action) { super(*args) }
end
private action_hook if private_method
end
true
else
false
end
end