From 68431b7083fefdc8e9364c35a9492f8872271110 Mon Sep 17 00:00:00 2001 From: Evadne Wu Date: Fri, 7 Aug 2015 15:37:09 +0800 Subject: [PATCH] fixes AASM::Persistence::Base#aasm_read_state not reading with the correct name --- lib/aasm/persistence/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/aasm/persistence/base.rb b/lib/aasm/persistence/base.rb index 83fd8da..3833a9c 100644 --- a/lib/aasm/persistence/base.rb +++ b/lib/aasm/persistence/base.rb @@ -35,7 +35,7 @@ module AASM def aasm_read_state(name=:default) state = send(self.class.aasm(name).attribute_name) 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 state.blank? ? nil : state.to_sym end