instance method prepare_all

Ruby on Rails 7.0.10

Since v7.0.10

Available in: v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

prepare_all()

No documentation comment.

Source
# File activerecord/lib/active_record/tasks/database_tasks.rb, line 188
      def prepare_all
        seed = false

        each_current_configuration(env) do |db_config|
          ActiveRecord::Base.establish_connection(db_config)

          begin
            # Skipped when no database
            migrate

            if ActiveRecord.dump_schema_after_migration
              dump_schema(db_config, ActiveRecord.schema_format)
            end
          rescue ActiveRecord::NoDatabaseError
            create(db_config)

            if File.exist?(schema_dump_path(db_config))
              load_schema(
                db_config,
                ActiveRecord.schema_format,
                nil
              )
            else
              migrate
            end

            seed = true
          end
        end

        ActiveRecord::Base.establish_connection
        load_seed if seed
      end

Defined in activerecord/lib/active_record/tasks/database_tasks.rb line 188 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Tasks::DatabaseTasks

Type at least 2 characters to search.

↑↓ navigate · open · esc close