mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
move things into SequelHelper that are only used there.
This commit is contained in:
parent
4013cba733
commit
469ab03c65
5 changed files with 11 additions and 15 deletions
|
@ -1,9 +1,6 @@
|
|||
require 'database_cleaner/sequel/deletion'
|
||||
require 'database_cleaner/shared_strategy'
|
||||
require 'sequel'
|
||||
require 'support/sequel/sequel_setup'
|
||||
# XXX: use ActiveRecord's db_config (`db/config.yml`) for CI/dev convenience
|
||||
require 'support/active_record/database_setup'
|
||||
require 'support/sequel/sequel_helper'
|
||||
|
||||
module DatabaseCleaner
|
||||
module Sequel
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'database_cleaner/sequel/transaction'
|
||||
require 'database_cleaner/shared_strategy'
|
||||
require 'sequel'
|
||||
require 'support/sequel/sequel_helper'
|
||||
|
||||
module DatabaseCleaner
|
||||
module Sequel
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
require 'database_cleaner/sequel/truncation'
|
||||
require 'database_cleaner/shared_strategy'
|
||||
require 'sequel'
|
||||
require 'support/sequel/sequel_setup'
|
||||
# XXX: use ActiveRecord's db_config (`db/config.yml`) for CI/dev convenience
|
||||
require 'support/active_record/database_setup'
|
||||
require 'support/sequel/sequel_helper'
|
||||
|
||||
module DatabaseCleaner
|
||||
module Sequel
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
require 'yaml'
|
||||
|
||||
def db_config
|
||||
config_path = 'db/config.yml'
|
||||
@db_config ||= YAML.load(IO.read(config_path))
|
||||
end
|
|
@ -1,3 +1,11 @@
|
|||
require 'sequel'
|
||||
require 'yaml'
|
||||
|
||||
def db_config
|
||||
config_path = 'db/config.yml'
|
||||
@db_config ||= YAML.load(IO.read(config_path))
|
||||
end
|
||||
|
||||
class SequelHelper < Struct.new(:config)
|
||||
def setup
|
||||
if config[:url] == "postgres:///" || config[:url] == "sqlite:///"
|
Loading…
Reference in a new issue