mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 11:10:12 +01:00
fix (seemingly) bug in aasm
This commit is contained in:
parent
330d6e008c
commit
f0826ac851
1 changed files with 6 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue