lib/fsm/machine.rb in simplificator-fsm-0.3.0 vs lib/fsm/machine.rb in simplificator-fsm-0.3.2
- old
+ new
@@ -37,11 +37,10 @@
from_state.add_transition(transition)
self.transitions << transition
end
def self.get_current_state_name(target)
- value = target.send(Machine[target.class].current_state_attribute_name)
- (value && value.is_a?(String)) ? value.intern : value
+ target.send(Machine[target.class].current_state_attribute_name) || self.initial_state_name
end
def self.set_current_state_name(target, value)
target.send("#{Machine[target.class].current_state_attribute_name}=", value)
end
\ No newline at end of file