Class: DatabaseCleaner::ActiveRecord::Seeded

Inherits:
Deletion
  • Object
show all
Defined in:
lib/database_cleaner/active_record/seeded/adapter/mysql.rb,
lib/database_cleaner/active_record/seeded.rb,
lib/database_cleaner/active_record/seeded/configuration.rb

Overview

I hate this, but omitting it gives a superclass violation

Defined Under Namespace

Modules: Adapter Classes: Configuration

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.configurationObject



21
22
23
# File 'lib/database_cleaner/active_record/seeded.rb', line 21

def configuration
  @configuration ||= Configuration.new
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



17
18
19
# File 'lib/database_cleaner/active_record/seeded.rb', line 17

def configure
  yield(configuration)
end

Instance Method Details

#prepare(&seed_data_proc) ⇒ Object



30
31
32
33
# File 'lib/database_cleaner/active_record/seeded.rb', line 30

def prepare(&seed_data_proc)
  generate_seeds(seed_data_proc) unless skip_seeds_generation?
  clean
end

#startObject



26
27
28
# File 'lib/database_cleaner/active_record/seeded.rb', line 26

def start
  adapter.inject_seeds_from_fixtures_file
end