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

Make sure ArResolver works for other adapter with proxy #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

untwal
Copy link

@untwal untwal commented Feb 24, 2021

Resolve this, other adapters need some proxy which might not be the primary one.

@untwal
Copy link
Author

untwal commented Feb 24, 2021

@tsukasaoishi can you please review this.

@untwal untwal changed the title Make sure ArResolver works for primary only Make sure ArResolver works for other adapter with proxy Feb 24, 2021
base_adapter_name = "#{specification.config[:adapter].to_s}_adapter".camelize
__extend_adapter_by_fc(
"::ActiveRecord::ConnectionAdapters::#{base_adapter_name}".constantize,
OtherAdapterProxy
Copy link
Owner

Choose a reason for hiding this comment

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

I'd like to be able to specify an extend module(like OtherAdapterProxy) in a configurations.

example:
config/initializers/fresh_connection.rb

FreshConnection.extend_adapter_proxy = OtherAdapterProxy

Could you to be able to add a function like above?
If it seems difficult for you, I will implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants