Module: DatabaseRewinder::Compatibility
- Included in:
- DatabaseRewinder
- Defined in:
- lib/database_rewinder/compatibility.rb
Instance Method Summary collapse
- #[](orm, connection: nil) ⇒ Object
- #clean_with(*args) ⇒ Object
- #start ⇒ Object
- #strategy=(args) ⇒ Object
Instance Method Details
#[](orm, connection: nil) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/database_rewinder/compatibility.rb', line 15 def [](orm, connection: nil, **) if connection.nil? if orm.is_a? String connection = orm elsif orm.is_a?(Hash) && orm.has_key?(:connection) connection = orm[:connection] end end super connection end |
#clean_with(*args) ⇒ Object
3 4 5 |
# File 'lib/database_rewinder/compatibility.rb', line 3 def clean_with(*args) cleaners.each {|c| c.clean_with(*args)} end |
#start ⇒ Object
7 |
# File 'lib/database_rewinder/compatibility.rb', line 7 def start; end |
#strategy=(args) ⇒ Object
9 10 11 12 13 |
# File 'lib/database_rewinder/compatibility.rb', line 9 def strategy=(args) = args.is_a?(Array) ? args. : {} @only, @except = [:only], [:except] cleaners.each {|c| c.strategy = nil, } end |