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

Implement connecting_to method #40486

Merged

Conversation

eileencodes
Copy link
Member

We have code at github that ensures the console is booted in readonly mode. I noticed there wasn't a public API for this so I added this method.


Sometimes you need to have a different default connection but aren't
calling the connection with a block. An example is booting a console in
reading method. This adds the ability for a script to set a specific
connection on boot while preserving the behavior of connected_to for
application code.

cc/ @rafaelfranca @seejohnrun @tenderlove @jhawthorn

@eileencodes eileencodes force-pushed the add-method-to-set-specific-connection branch from e3f45cf to 386a06b Compare October 29, 2020 20:53
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.

👍

The only thing that I was in doubt is that I'd expect a method called connection_for to return a connection.

Maybe a more descriptive name of that it does would be connecting_to?

Sometimes you need to have a different default connection but aren't
calling the connection with a block. An example is booting a console in
`reading` mode. This adds the ability for a script to set a specific
connection on boot while preserving the behavior of `connected_to` for
application code.
@eileencodes eileencodes force-pushed the add-method-to-set-specific-connection branch from 386a06b to 231bcc7 Compare October 29, 2020 21:14
@eileencodes
Copy link
Member Author

Good call, I've updated the method name. 👍🏻

@eileencodes eileencodes changed the title Implement a connection_for method Implement connecting_to method Oct 29, 2020
@eileencodes eileencodes merged commit 2c327e6 into rails:master Oct 29, 2020
@eileencodes eileencodes deleted the add-method-to-set-specific-connection branch October 29, 2020 21:31
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

2 participants