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 | |
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')
-rw-r--r-- | activerecord/lib/active_record/middleware/database_selector/resolver/session.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/middleware/database_selector/resolver/session.rb b/activerecord/lib/active_record/middleware/database_selector/resolver/session.rb index 33e0af5ee4..df7af054b7 100644 --- a/activerecord/lib/active_record/middleware/database_selector/resolver/session.rb +++ b/activerecord/lib/active_record/middleware/database_selector/resolver/session.rb @@ -10,7 +10,7 @@ module ActiveRecord # The last_write is used to determine whether it's safe to read # from the replica or the request needs to be sent to the primary. class Session # :nodoc: - def self.build(request) + def self.call(request) new(request.session) end |