Skip to content

Draft: Add a feature flag use_base_class_in_proxy_util

Ravi Kumar requested to merge proxy_util-refactoring into master

What does this MR do and why?

Added a feature_flag use_base_class_in_proxy_util which simplifies the code inside the proxy_util to find the Config. Feature flag uses the base_class method. For all the ApplicationRecord classes .base_class always gives the deepest parent class which is inheriting from ApplicationRecord.

Note: For non ApplicationRecord base_class method is not defined. We have two classes Wiki and Repository which are non ApplicationRecord and they don't have base_class implemented. I don't think we should use respond_to? to avoid exceptions. If there is an exception we should implement the method base_class. For now, there will be no exception because use_separate_indices is false.

How to set up and validate locally

Just enable the feature flag and perform some global searching. And verify everything works as before.

Feature.enable :use_base_class_in_proxy_util

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Ravi Kumar

Merge request reports