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

Add Deprecators#disallowed_warnings= #46583

Merged

Conversation

jonathanhefner
Copy link
Member

Although disallowed warnings are likely to be deprecator-specific, it can be useful to set this value once and have it applied to any deprecators that are added later. For example, setting the value in an initializer via config.active_support.disallowed_deprecation_warnings and applying it to any third-party deprecators that are added later in the boot process. Also, when using :all, it is more convenient to write deprecators.disallowed_warnings = :all instead of deprecators.each { |deprecator| deprecator.disallowed_warnings = :all }.

Although disallowed warnings are likely to be deprecator-specific, it
can be useful to set this value once and have it applied to any
deprecators that are added later.  For example, setting the value in an
initializer via `config.active_support.disallowed_deprecation_warnings`
and applying it to any third-party deprecators that are added later in
the boot process.  Also, when using `:all`, it is more convenient to
write `deprecators.disallowed_warnings = :all` instead of
`deprecators.each { |deprecator| deprecator.disallowed_warnings = :all }`.
@george-ma
Copy link
Contributor

Hey @jonathanhefner! Great work done overall revamping Rails.application.deprecators.

I have one feature thats similar to this PR that I was wondering if you had some initial thoughts on; Adding :rails as a value for config.active_support.disallowed_deprecation_warnings, that will configure only deprecation warnings that originate from rails to be disallowed. I put up a PR on Shopify/rails if you have a minute to check it out and let me know if this sounds like a reasonable feature addition! Shopify#16

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