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 Appsignal.configure .env? helper #1333

Merged
merged 1 commit into from
Nov 12, 2024
Merged

Add Appsignal.configure .env? helper #1333

merged 1 commit into from
Nov 12, 2024

Conversation

tombruijn
Copy link
Member

When adding environment specific config with an if-statement comparing the current environment, they need to use a String. If apps compare a String with a Symbol like config.env == :production it would return false.

Apps can call Appsignal.configure(:production) with a Symbol and we'll cast it to a String. The environment in the Config class is always a String.

Add the config.env? helper to handle the casting of the environment value so that our users don't have to bother with casting the environment value to a String.

When adding environment specific config with an if-statement comparing
the current environment, they need to use a String. If apps compare a
String with a Symbol like `config.env == :production` it would return
false.

Apps can call `Appsignal.configure(:production)` with a Symbol and we'll
cast it to a String. The environment in the Config class is always a
String.

Add the `config.env?` helper to handle the casting of the environment
value so that our users don't have to bother with casting the
environment value to a String.
@tombruijn tombruijn merged commit 8b234ca into main Nov 12, 2024
127 checks passed
@tombruijn tombruijn deleted the config-env-helper branch November 12, 2024 15:34
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.

3 participants