module Quiver::Mappers

Public Class Methods

transaction(&block) click to toggle source
# File lib/quiver/mappers.rb, line 3
def self.transaction(&block)
  raise ArgumentError, "#transaction requires a block" unless block_given?

  root_module = self.parent
  adapter_type = root_module::Application.default_adapter_type

  transaction_klass = self.const_get("#{adapter_type.to_s.camelize}Transaction")
  transaction_klass.transaction(root_module, &block)
end