mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
replace Configuration with Cleaners, as the former is just a wrapper, now.
This commit is contained in:
parent
9055df104f
commit
6105b5f647
2 changed files with 3 additions and 28 deletions
|
@ -1,9 +1,6 @@
|
||||||
require 'database_cleaner/base'
|
require 'database_cleaner/base'
|
||||||
require 'database_cleaner/deprecation'
|
|
||||||
require 'forwardable'
|
|
||||||
|
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
|
|
||||||
class Cleaners < Hash
|
class Cleaners < Hash
|
||||||
def initialize hash={}
|
def initialize hash={}
|
||||||
super.replace(hash)
|
super.replace(hash)
|
||||||
|
@ -56,23 +53,4 @@ module DatabaseCleaner
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Configuration
|
|
||||||
def initialize
|
|
||||||
@cleaners ||= Cleaners.new
|
|
||||||
end
|
|
||||||
|
|
||||||
extend Forwardable
|
|
||||||
delegate [
|
|
||||||
:[],
|
|
||||||
:strategy=,
|
|
||||||
:orm=,
|
|
||||||
:start,
|
|
||||||
:clean,
|
|
||||||
:cleaning,
|
|
||||||
:clean_with,
|
|
||||||
] => :cleaners
|
|
||||||
|
|
||||||
attr_accessor :cleaners
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,8 +8,6 @@ module DatabaseCleaner
|
||||||
extend Forwardable
|
extend Forwardable
|
||||||
delegate [
|
delegate [
|
||||||
:[],
|
:[],
|
||||||
:cleaners,
|
|
||||||
:cleaners=,
|
|
||||||
:strategy=,
|
:strategy=,
|
||||||
:orm=,
|
:orm=,
|
||||||
:start,
|
:start,
|
||||||
|
@ -20,10 +18,9 @@ module DatabaseCleaner
|
||||||
|
|
||||||
attr_accessor :allow_remote_database_url, :allow_production, :url_whitelist
|
attr_accessor :allow_remote_database_url, :allow_production, :url_whitelist
|
||||||
|
|
||||||
private
|
def cleaners
|
||||||
|
@cleaners ||= Cleaners.new
|
||||||
def configuration
|
|
||||||
@configuration ||= Configuration.new
|
|
||||||
end
|
end
|
||||||
|
attr_writer :cleaners
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue