mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Properly give defaults for DatabaseSelector options
The initializer receives `nil` for these options when no cofigurations were given: https://github.com/rails/rails/blob/v6.0.0.rc1/activerecord/lib/active_record/railtie.rb#L91-L97
This commit is contained in:
parent
01f8abd7b2
commit
cecbc2340a
1 changed files with 3 additions and 3 deletions
|
@ -35,10 +35,10 @@ module ActiveRecord
|
|||
# config.active_record.database_resolver = MyResolver
|
||||
# config.active_record.database_resolver_context = MyResolver::MySession
|
||||
class DatabaseSelector
|
||||
def initialize(app, resolver_klass = Resolver, context_klass = Resolver::Session, options = {})
|
||||
def initialize(app, resolver_klass = nil, context_klass = nil, options = {})
|
||||
@app = app
|
||||
@resolver_klass = resolver_klass
|
||||
@context_klass = context_klass
|
||||
@resolver_klass = resolver_klass || Resolver
|
||||
@context_klass = context_klass || Resolver::Session
|
||||
@options = options
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue