Parent

Methods

Files

DatabaseCleaner::TruncationBase

Public Class Methods

new(options = {}) click to toggle source
# File lib/database_cleaner/truncation_base.rb, line 4
def initialize(options = {})
  if !options.empty? && !(options.keys - [:only, :except]).empty?
    raise ArgumentError, "The only valid options are :only and :except. You specified #{options.keys.join(',')}."
  end
  if options.has_key?(:only) && options.has_key?(:except)
    raise ArgumentError, "You may only specify either :only or :either.  Doing both doesn't really make sense does it?"
  end

  @only = options[:only]
  @tables_to_exclude = (options[:except] || [])
  if migration_storage = migration_storage_name
    @tables_to_exclude << migration_storage
  end
end

Public Instance Methods

clean() click to toggle source
# File lib/database_cleaner/truncation_base.rb, line 23
def clean
  raise NotImplementedError
end
start() click to toggle source
# File lib/database_cleaner/truncation_base.rb, line 19
def start
  # no-op
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.