module AASM::Persistence::RedisPersistence::InstanceMethods
def aasm_write_state(state, name=:default)
Foo[1].aasm.current_state # => :closed
foo.aasm.current_state # => :closed
foo.close!
foo.aasm.current_state # => :opened
foo = Foo[1]
Writes state to the state column and persists it to the database
def aasm_write_state(state, name=:default) aasm_column = self.class.aasm(name).attribute_name send("#{aasm_column}").value = state end