1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Update docs for ActiveRecord::Middleware::DatabaseSelector [ci skip]

The docs for this middleware indicate that you can set a delay that
can be a duration (eg. `2.seconds`).

https://api.rubyonrails.org/v6.1/classes/ActiveRecord/Middleware/DatabaseSelector.html

In normal apps, this works fine without an explicit require because
the extension is required through other libs. However, when creating a
minimal app, this results in an undefined method error.

This is something that is already being included in
test/development/production config files since c8c5497.
This commit is contained in:
Ricardo Díaz 2021-05-08 23:11:13 -05:00
parent d89d14d241
commit 3c748cc569

View file

@ -22,9 +22,13 @@ module ActiveRecord
# To use the DatabaseSelector in your application with default settings add
# the following options to your environment config:
#
# config.active_record.database_selector = { delay: 2.seconds }
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
# require "active_support/core_ext/integer/time"
#
# class Application < Rails::Application
# config.active_record.database_selector = { delay: 2.seconds }
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
# end
#
# New applications will include these lines commented out in the production.rb.
#