Module: AASM::Persistence::MongoMapperPersistence::WriteStateWithoutPersistence
- Defined in:
- lib/aasm/persistence/mongo_mapper_persistence.rb
Instance Method Summary collapse
-
#aasm_write_state_without_persistence(state) ⇒ Object
Writes
state
to the state column, but does not persist it to the database.
Instance Method Details
#aasm_write_state_without_persistence(state) ⇒ Object
Writes state
to the state column, but does not persist it to the database
foo = Foo.find(1)
foo.aasm_current_state # => :opened
foo.close
foo.aasm_current_state # => :closed
Foo.find(1).aasm_current_state # => :opened
foo.save
foo.aasm_current_state # => :closed
Foo.find(1).aasm_current_state # => :closed
NOTE: intended to be called from an event
161 162 163 |
# File 'lib/aasm/persistence/mongo_mapper_persistence.rb', line 161 def aasm_write_state_without_persistence(state) write_attribute(self.class.aasm_column, state.to_s) end |