method

truncate_tables

Importance_0
v6.0.0 - Show latest stable - 0 notes - Class: DatabaseTasks
truncate_tables(configuration) private

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/tasks/database_tasks.rb, line 212
      def truncate_tables(configuration)
        ActiveRecord::Base.connected_to(database: { truncation: configuration }) do
          conn = ActiveRecord::Base.connection
          table_names = conn.tables
          table_names -= [
            conn.schema_migration.table_name,
            InternalMetadata.table_name
          ]

          ActiveRecord::Base.connection.truncate_tables(*table_names)
        end
      end
Register or log in to add new notes.