Module: Sequel::Plugins::StateMachineAuditLog::DatasetMethods

Defined in:
lib/sequel/plugins/state_machine_audit_log.rb

Instance Method Summary collapse

Instance Method Details

#failedObject



38
39
40
41
42
43
# File 'lib/sequel/plugins/state_machine_audit_log.rb', line 38

def failed
  colmap = self.state_machine_column_mappings
  tostate_col = colmap[:to_state]
  fromstate_col = colmap[:from_state]
  return self.where(tostate_col => fromstate_col)
end

#succeededObject



45
46
47
48
49
50
# File 'lib/sequel/plugins/state_machine_audit_log.rb', line 45

def succeeded
  colmap = self.state_machine_column_mappings
  tostate_col = colmap[:to_state]
  fromstate_col = colmap[:from_state]
  return self.exclude(tostate_col => fromstate_col)
end