fix (seemingly) bug in aasm

This commit is contained in:
Stefan Richter 2011-01-24 22:42:51 +08:00 committed by Reinier Balt
parent 330d6e008c
commit f0826ac851

View file

@ -143,7 +143,12 @@ module ScottBarron #:nodoc:
# Returns the current state the object is in, as a Ruby symbol.
def current_state
self.send(self.class.state_column).to_sym
x = self.send(self.class.state_column)
return x.to_sym if not x.nil?
# if current state is not yet set, set it
self.set_initial_state
return self.current_state
end
# Returns what the next state for a given event would be, as a Ruby symbol.