Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow calling connected_to on subclasses of ActiveRecord::Base #38580

Conversation

seejohnrun
Copy link
Member

Behavior has not changed here but the previous API could be
misleading to people who thought it would switch connections for only
that class. connected_to switches the context from which we are
getting connections, not the connections themselves.

cc / @eileencodes

@eileencodes eileencodes force-pushed the disallow-calling-connected_to-on-subclasses-of-ar-base branch from 13ef4ff to 90d6b80 Compare February 26, 2020 20:37
Copy link
Member

@rafaelfranca rafaelfranca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should activerecord/db/primary_shard_one.sqlite3 be here?

Behavior has not changed here but the previous API could be
misleading to people who thought it would switch connections for only
that class. `connected_to` switches the context from which we are
getting connections, not the connections themselves.

Co-authored-by: John Crepezzi <john.crepezzi@gmail.com>
@seejohnrun seejohnrun force-pushed the disallow-calling-connected_to-on-subclasses-of-ar-base branch from 90d6b80 to b7b26fa Compare February 26, 2020 21:08
@seejohnrun
Copy link
Member Author

@rafaelfranca Fixed now, thank you!

@rafaelfranca rafaelfranca merged commit 03d32ca into rails:master Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants