method
create_fixtures
v6.0.0 -
Show latest stable
-
0 notes -
Class: FixtureSet
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2 (0)
- 4.1.8 (0)
- 4.2.1 (0)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
create_fixtures(fixtures_directory, fixture_set_names, class_names = {}, config = ActiveRecord::Base, &block)
public
Hide source
# File activerecord/lib/active_record/fixtures.rb, line 534 def create_fixtures(fixtures_directory, fixture_set_names, class_names = {}, config = ActiveRecord::Base, &block) fixture_set_names = Array(fixture_set_names).map(&:to_s) class_names = ClassCache.new class_names, config # FIXME: Apparently JK uses this. connection = block_given? ? block : lambda { ActiveRecord::Base.connection } fixture_files_to_read = fixture_set_names.reject do |fs_name| fixture_is_cached?(connection.call, fs_name) end if fixture_files_to_read.any? fixtures_map = read_and_insert( fixtures_directory, fixture_files_to_read, class_names, connection, ) cache_fixtures(connection.call, fixtures_map) end cached_fixtures(connection.call, fixture_set_names) end