lib/simple_states.rb in simple_states-1.1.0.rc3 vs lib/simple_states.rb in simple_states-1.1.0.rc5
- old
+ new
@@ -71,11 +71,10 @@
super.try(:to_sym)
end
def reset_state
self.state = self.class.initial_state
- states = self.class.state_names - [self.class.initial_state]
- states.each { |state| self.send(:"#{state}_at=", nil) if respond_to?(:"#{state}_at=") }
+ self.class.events.map { |*args| Event.new(*args).reset(self) }
end
def past_states
@past_states ||= []
end