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 that by default the gem_name is rails #114

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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

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:/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.
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.

1 participant