Module: Laminar::Transacticle::ClassMethods

Defined in:
lib/laminar/transacticle.rb

Overview

Laminar::Particle class methods and attributes.

Instance Method Summary collapse

Instance Method Details

#call_with_txn(context = {}) ⇒ Object



19
20
21
22
23
# File 'lib/laminar/transacticle.rb', line 19

def call_with_txn(context = {})
  self.call_with_txn!(context)
rescue ParticleStopped
  context
end

#call_with_txn!(context = {}) ⇒ Object



25
26
27
28
29
# File 'lib/laminar/transacticle.rb', line 25

def call_with_txn!(context = {})
  ActiveRecord::Base.transaction do
    self.call!(context)
  end
end