Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
cecbc23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eileencodes I pushed this commit because I firstly found this to be a tiny careless bug, but I'm now confused seeing this documentation.
rails/activerecord/lib/active_record/middleware/database_selector.rb
Lines 22 to 27 in cecbc23
Was this totally intentional that we have to explicitly configure all three options here? We were getting a nil error when the klasses were not specified, but was that a designed behavior?
If so, I'll revert this commit (and maybe I'll add a warning message or something that tells the users to explicitly configure these klasses).
cecbc23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine. Thanks for letting me know.
cecbc23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😌
cecbc23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amatsuda did you apply this commit to 6-0-stable?
cecbc23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafaelfranca Yes. Shouldn't I?