diff --git a/lib/aasm/persistence/active_record_persistence.rb b/lib/aasm/persistence/active_record_persistence.rb index 7e3abed..7af4815 100644 --- a/lib/aasm/persistence/active_record_persistence.rb +++ b/lib/aasm/persistence/active_record_persistence.rb @@ -164,7 +164,9 @@ module AASM # foo.aasm_state # => nil # def aasm_ensure_initial_state - if respond_to?(self.class.aasm.attribute_name) && send(self.class.aasm.attribute_name).blank? + # checking via respond_to? does not work in Rails <= 3 + # if respond_to?(self.class.aasm.attribute_name) && send(self.class.aasm.attribute_name).blank? # Rails 4 + if attributes.key?(self.class.aasm.attribute_name.to_s) && send(self.class.aasm.attribute_name).blank? aasm.enter_initial_state end end