Skip to content

Make sure ArResolver works for other adapter with proxy#39

Open
untwal wants to merge 1 commit intotsukasaoishi:mainfrom
untwal:protected/resolver/prepend
Open

Make sure ArResolver works for other adapter with proxy#39
untwal wants to merge 1 commit intotsukasaoishi:mainfrom
untwal:protected/resolver/prepend

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 force-pushed the protected/resolver/prepend branch from fb009aa to f462315 Compare February 24, 2021 14:26
@untwal untwal changed the title Make sure ArResolver works for primary only Make sure ArResolver works for other adapter with proxy Feb 24, 2021
@untwal untwal force-pushed the protected/resolver/prepend branch from f462315 to 66bc23f Compare February 24, 2021 14:34
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

Development

Successfully merging this pull request may close these issues.

This adapter('redshift') is not supported. If you specified the mysql or postgres adapter, it's probably a bug in FreshConnection

2 participants