Module: DatabaseCleaner::Sequel::Base

Includes:
Generic::Base
Included in:
Transaction, Truncation
Defined in:
lib/database_cleaner/sequel/base.rb

Instance Method Summary collapse

Methods included from Generic::Base

#cleaning, included

Instance Method Details

#dbObject



15
16
17
18
19
# File 'lib/database_cleaner/sequel/base.rb', line 15

def db
  return @db if @db && @db != :default
  raise "As you have more than one active sequel database you have to specify the one to use manually!" if ::Sequel::DATABASES.count > 1 
  ::Sequel::DATABASES.first || :default
end

#db=(desired_db) ⇒ Object



11
12
13
# File 'lib/database_cleaner/sequel/base.rb', line 11

def db=(desired_db)
  @db = desired_db
end