method

insert_fixtures_set

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters::DatabaseStatements
insert_fixtures_set(fixture_set, tables_to_delete = []) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb, line 381
      def insert_fixtures_set(fixture_set, tables_to_delete = [])
        fixture_inserts = fixture_set.map do |table_name, fixtures|
          next if fixtures.empty?

          build_fixture_sql(fixtures, table_name)
        end.compact

        table_deletes = tables_to_delete.map { |table| "DELETE FROM #{quote_table_name table}".dup }
        total_sql = Array.wrap(combine_multi_statements(table_deletes + fixture_inserts))

        disable_referential_integrity do
          transaction(requires_new: true) do
            total_sql.each do |sql|
              execute sql, "Fixtures Load"
              yield if block_given?
            end
          end
        end
      end
Register or log in to add new notes.