Class: Cats::Core::Transaction

Inherits:
ApplicationRecord show all
Defined in:
app/models/cats/core/transaction.rb

Constant Summary collapse

DRAFT =

Transaction statuses

"Draft".freeze
COMMITTED =
"Committed".freeze
STATUSES =
[DRAFT, COMMITTED].freeze

Instance Method Summary collapse

Instance Method Details

#commitObject

Raises:

  • (NotImplementedError)


20
21
22
# File 'app/models/cats/core/transaction.rb', line 20

def commit
  raise(NotImplementedError, "Method should be implemented in child classes.")
end

#set_statusObject



24
25
26
27
28
# File 'app/models/cats/core/transaction.rb', line 24

def set_status
  return unless new_record?

  self.status = DRAFT
end