Module: AASM::Persistence::ActiveRecordPersistence::InstanceMethods

Defined in:
lib/aasm/persistence/active_record_persistence.rb

Instance Method Summary collapse

Instance Method Details

#aasm_current_stateObject

Returns the current aasm_state of the object. Respects reload and any changes made to the aasm_state field directly

Internally just calls aasm_read_state

foo = Foo.find(1)
foo.aasm_current_state # => :pending
foo.aasm_state = "opened"
foo.aasm_current_state # => :opened
foo.close # => calls aasm_write_state_without_persistence
foo.aasm_current_state # => :closed
foo.reload
foo.aasm_current_state # => :pending


136
137
138
# File 'lib/aasm/persistence/active_record_persistence.rb', line 136

def aasm_current_state
  @current_state = aasm_read_state
end