Module: Workflow::ActiveRecordInstanceMethods
- Defined in:
- lib/workflow.rb
Instance Method Summary collapse
- #load_workflow_state ⇒ Object
-
#persist_workflow_state(new_value) ⇒ Object
On transition the new workflow state is immediately saved in the database.
Instance Method Details
#load_workflow_state ⇒ Object
339 340 341 |
# File 'lib/workflow.rb', line 339 def load_workflow_state read_attribute(self.class.workflow_column) end |
#persist_workflow_state(new_value) ⇒ Object
On transition the new workflow state is immediately saved in the database.
345 346 347 348 349 350 351 352 353 |
# File 'lib/workflow.rb', line 345 def persist_workflow_state(new_value) if self.respond_to? :update_column # Rails 3.1 or newer update_column self.class.workflow_column, new_value else # older Rails; beware of side effect: other (pending) attribute changes will be persisted too update_attribute self.class.workflow_column, new_value end end |