Module: DatabaseCleaner::Generic::Surgicalstrike

Included in:
ActiveRecord::Surgicalstrike
Defined in:
lib/database_cleaner/generic/surgicalstrike.rb

Instance Method Summary collapse

Instance Method Details

#cleanObject

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/database_cleaner/generic/surgicalstrike.rb', line 28

def clean
  raise NotImplementedError
end

#initialize(opts = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/database_cleaner/generic/surgicalstrike.rb', line 11

def initialize(opts={})
  if !opts.empty? && !(opts.keys - [:only, :except]).empty?
    raise ArgumentError, "The only valid options are :only and :except. You specified #{opts.keys.join(',')}."
  end
  if opts.has_key?(:only) && opts.has_key?(:except)
    raise ArgumentError, "You may only specify either :only or :except.  Doing both doesn't really make sense does it?"
  end

  @only = opts[:only]
  @tables_to_exclude = (opts[:except] || []).dup
  @tables_to_exclude << migration_storage_name if migration_storage_name
end

#startObject

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/database_cleaner/generic/surgicalstrike.rb', line 24

def start
  raise NotImplementedError
end