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