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

Clarify how to attach to a custom deprecator #114

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

ignacio-chiazzo
Copy link
Member

@ignacio-chiazzo ignacio-chiazzo commented Oct 2, 2024

I am using this gem on a repository that doesn't use Rails. I migrated from ActiveSupport::Deprecation.warn(...) to ActiveSupport::Deprecation.new.warn(), and it did not log any deprecation calls.

The reason is that, by default, the gem attaches to :rails.

This PR clarifies in the README that if you're not using Rails, you should set attach_to correctly.

Example:

DeprecationToolkit::Configuration.configure do |config|
  config.attach_to = ["my_cool_gem", "test_case"]
  config.behaviour = :notify
  # more stuff
end

ignacio-chiazzo and others added 2 commits November 5, 2024 11:22
I am using this gem on a repository that isn't using Rails. I migrated from  `ActiveSupport::Deprecation.warn(...)` to `ActiveSupport::Deprecation.new.warn()` and it was not logging any deprecation call.

The reason is that, by default , [the gem attaches to :rails](https://github.com/Shopify/deprecation_toolkit/blob/953c26d48a75edcf844c97437f2596d414a7bebf/lib/deprecation_toolkit.rb#L37-L39). 

This PR clarifies in the README that if you're not using Rails then you should set `attach_to` correctly.
@etiennebarrie etiennebarrie force-pushed the ignacio-chiazzo-patch-1 branch from 8f37450 to 36fd273 Compare November 5, 2024 10:23
@etiennebarrie etiennebarrie changed the title Clarify that by default the gem_name is rails Clarify how to attach to a custom deprecator Nov 5, 2024
@etiennebarrie
Copy link
Member

Tweaked the wording a bit, thanks for your contribution!

@etiennebarrie etiennebarrie merged commit e0de8bb into main Nov 5, 2024
37 checks passed
@etiennebarrie etiennebarrie deleted the ignacio-chiazzo-patch-1 branch November 5, 2024 10:42
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.

2 participants