diff options
author | John Hawthorn <john@hawthorn.email> | 2019-02-06 11:55:53 -0800 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2019-02-06 11:55:53 -0800 |
commit | 6aaf01385e95376938275f484852b88fe84088b8 (patch) | |
tree | 92fc791e538f50c41386fa24426fe380aa2e427a /activerecord/lib/active_record/middleware/database_selector.rb | |
parent | 9cc463ed7b7be098602b72a98f72220ea6466ba2 (diff) | |
download | rails-6aaf01385e95376938275f484852b88fe84088b8.tar.gz rails-6aaf01385e95376938275f484852b88fe84088b8.tar.bz2 rails-6aaf01385e95376938275f484852b88fe84088b8.zip |
Rename Session.build to Session.call
This is more consistent with Resolver, which has build called. This
allows using a Proc instead of a class, which could be nice if you need
to vary switching logic based on the request in a more ad-hoc way (ie.
check if it is an API request).
Diffstat (limited to 'activerecord/lib/active_record/middleware/database_selector.rb')
-rw-r--r-- | activerecord/lib/active_record/middleware/database_selector.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/middleware/database_selector.rb b/activerecord/lib/active_record/middleware/database_selector.rb index 3ab50f5f6b..b95d8d6cb6 100644 --- a/activerecord/lib/active_record/middleware/database_selector.rb +++ b/activerecord/lib/active_record/middleware/database_selector.rb @@ -57,7 +57,7 @@ module ActiveRecord private def select_database(request, &blk) - operations = operations_klass.build(request) + operations = operations_klass.call(request) database_resolver = resolver_klass.call(operations, options) if reading_request?(request) |