You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
The use case is to disable active_record_named_scope, because I want to define my own with more specific parameters, but simply adding a rbi file with the desired definition results in Method XYZ.the_scope redefined with argument args as a splat argument https://srb.help/4010.
I tried putting the following in config/initializers/sorbet_rails.rb but it did not appear to work.
SorbetRails.configure do |config|
config.enabled_model_plugins.delete(:active_record_named_scope)
end
(from what I can tell (but am not sure), there is a call to register_configured_plugins even before we run the configuration code)
Note: a workaround seems to be SorbetRails::ModelRbiFormatter.get_plugins.delete(SorbetRails::ModelPlugins::ActiveRecordNamedScope) in the config, though I guess this is undocumented and not guaranteed to work forever
The text was updated successfully, but these errors were encountered:
Thank you. I'll triage this. It does look like we call register_configured_plugins in railtie's initialize. I'll look into if we can change where this call is called to fix the bug.
For the time being, please feel free to use the workaround you've identified. Likely it'll keep working. I'll let you know if any change may affect it.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is there a way to disable a builtin model plugin?
The use case is to disable
active_record_named_scope
, because I want to define my own with more specific parameters, but simply adding a rbi file with the desired definition results inMethod XYZ.the_scope redefined with argument args as a splat argument https://srb.help/4010
.I tried putting the following in
config/initializers/sorbet_rails.rb
but it did not appear to work.(from what I can tell (but am not sure), there is a call to
register_configured_plugins
even before we run the configuration code)Note: a workaround seems to be
SorbetRails::ModelRbiFormatter.get_plugins.delete(SorbetRails::ModelPlugins::ActiveRecordNamedScope)
in the config, though I guess this is undocumented and not guaranteed to work foreverThe text was updated successfully, but these errors were encountered: