parent
26219482f7
commit
97e1fa501d
|
@ -5,7 +5,8 @@ module AASM
|
||||||
# may be overwritten by persistence mixins
|
# may be overwritten by persistence mixins
|
||||||
def aasm_read_state(name=:default)
|
def aasm_read_state(name=:default)
|
||||||
# all the following lines behave like @current_state ||= aasm(name).enter_initial_state
|
# all the following lines behave like @current_state ||= aasm(name).enter_initial_state
|
||||||
current = aasm(name).instance_variable_get("@current_state_#{name}")
|
current = aasm(name).instance_variable_defined?("@current_state_#{name}") &&
|
||||||
|
aasm(name).instance_variable_get("@current_state_#{name}")
|
||||||
return current if current
|
return current if current
|
||||||
aasm(name).instance_variable_set("@current_state_#{name}", aasm(name).enter_initial_state)
|
aasm(name).instance_variable_set("@current_state_#{name}", aasm(name).enter_initial_state)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue