1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

fixes AASM::Persistence::Base#aasm_read_state not reading with the correct name

This commit is contained in:
Evadne Wu 2015-08-07 15:37:09 +08:00
parent d540ca8761
commit 68431b7083

View file

@ -35,7 +35,7 @@ module AASM
def aasm_read_state(name=:default) def aasm_read_state(name=:default)
state = send(self.class.aasm(name).attribute_name) state = send(self.class.aasm(name).attribute_name)
if new_record? if new_record?
state.blank? ? aasm.determine_state_name(self.class.aasm(name).initial_state) : state.to_sym state.blank? ? aasm(name).determine_state_name(self.class.aasm(name).initial_state) : state.to_sym
else else
state.blank? ? nil : state.to_sym state.blank? ? nil : state.to_sym
end end