Sha256: 2a604e8179526dc55647cee150ee362273c43e8f1fd875195ddc6664e40c78cc

Contents?: true

Size: 615 Bytes

Versions: 15

Compression:

Stored size: 615 Bytes

Contents

class Baza::InfoActiveRecordPg
  attr_reader :db

  def self.connection
    require "active_record"
    require "pg"

    @conn_pool ||= ::ActiveRecord::Base.establish_connection(
      adapter: "postgresql",
      database: "baza",
      username: "postgres"
    )
    @conn ||= @conn_pool.connection

    {pool: @conn_pool, conn: @conn}
  end

  def initialize(args = {})
    data = Baza::InfoActiveRecordPg.connection

    @db = Baza::Db.new({
      type: :active_record,
      conn: data.fetch(:conn)
    }.merge(args))
  end

  def before
    @db.tables.list(&:drop)
  end

  def after
    @db.close
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
baza-0.0.35 spec/info_active_record_pg_peak_flow.rb
baza-0.0.34 spec/info_active_record_pg_peak_flow.rb
baza-0.0.33 spec/info_active_record_pg_peak_flow.rb
baza-0.0.32 spec/info_active_record_pg_peak_flow.rb
baza-0.0.31 spec/info_active_record_pg_travis.rb
baza-0.0.30 spec/info_active_record_pg_travis.rb
baza-0.0.29 spec/info_active_record_pg_travis.rb
baza-0.0.28 spec/info_active_record_pg_travis.rb
baza-0.0.27 spec/info_active_record_pg_travis.rb
baza-0.0.26 spec/info_active_record_pg_travis.rb
baza-0.0.25 spec/info_active_record_pg_travis.rb
baza-0.0.24 spec/info_active_record_pg_travis.rb
baza-0.0.23 spec/info_active_record_pg_travis.rb
baza-0.0.22 spec/info_active_record_pg_travis.rb
baza-0.0.21 spec/info_active_record_pg_travis.rb