Module: Workflow::Adapter::ActiveRecord::InstanceMethods

Defined in:
lib/workflow/adapters/active_record.rb

Instance Method Summary collapse

Instance Method Details

#load_workflow_stateObject



11
12
13
# File 'lib/workflow/adapters/active_record.rb', line 11

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.



17
18
19
20
# File 'lib/workflow/adapters/active_record.rb', line 17

def persist_workflow_state(new_value)
  # Rails 3.1 or newer
  update_column self.class.workflow_column, new_value
end