Sha256: 62fd5e6fc1730304c1e82ee7e8af68b678920f4206fbe26afa5514bce8f69cd6

Contents?: true

Size: 469 Bytes

Versions: 1

Compression:

Stored size: 469 Bytes

Contents

require 'rails'
require 'rails_sandbox_server/engine'

class ActionController::Base
  before_action :sandbox_begin_transaction

  def sandbox_begin_transaction
    unless ActiveRecord::Base.connection.transaction_open?
      ActiveRecord::Base.connection.begin_transaction(joinable: false)
      logger.info "begin transaction #{ActiveRecord::Base.connection.current_transaction}"
    end
  end
end

module RailsSandboxServer
  class Railtie < Rails::Railtie
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_sandbox_server-0.0.2 lib/rails_sandbox_server.rb