lib/granite/action/transaction_manager.rb
# Runs a block in a transaction
# It will open a new transaction or append a block to the current one if it exists
# @return [Object] result of a block
Runs a block in a transaction
It will open a new transaction or append a block to the current one if it exists
Runs a block in a transaction It will open a new transaction or append a block to the current one if it exists
def run_in_transaction(&block)
          if defined?(ActiveRecord::Base)
            ActiveRecord::Base.transaction(requires_new: true) do
              transactions_stack.transaction(&block)
            end
          else
            transactions_stack.transaction(&block)
          end
        end
def run_in_transaction ( & block ) if defined? ( ActiveRecord :: Base ) ActiveRecord :: Base . transaction ( requires_new : true ) do transactions_stack . transaction ( & block ) end else transactions_stack . transaction ( & block ) end end
Runs a block in a transaction
It will open a new transaction or append a block to the current one if it exists
Runs a block in a transaction It will open a new transaction or append a block to the current one if it exists
result of a block
result of a block
Object
block