From 48d16c7ab4dbc35ac3d56ecf042ca165d609bb64 Mon Sep 17 00:00:00 2001 From: Tom de Bruijn Date: Mon, 11 Nov 2024 17:29:40 +0100 Subject: [PATCH] Improve changeset copy for appsignal.rb file These are suggestions from the review and my own improvements. --- .../add-config-appsignal-rb-file-support.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.changesets/add-config-appsignal-rb-file-support.md b/.changesets/add-config-appsignal-rb-file-support.md index 51437463..ccb8fe8a 100644 --- a/.changesets/add-config-appsignal-rb-file-support.md +++ b/.changesets/add-config-appsignal-rb-file-support.md @@ -5,7 +5,7 @@ type: add Add `config/appsignal.rb` config file support. When a `config/appsignal.rb` file is present in the app, the Ruby gem will automatically load it when `Appsignal.start` is called. -The `config/appsignal.rb` config file is a replacement for the `config/appsignal.yml` config file. When both files are present, only the `config/appsignal.rb` config file is loaded. +The `config/appsignal.rb` config file is a replacement for the `config/appsignal.yml` config file. When both files are present, only the `config/appsignal.rb` config file is loaded when the configuration file is automatically loaded by AppSignal when the configuration file is automatically loaded by AppSignal. Example `config/appsignal.rb` config file: @@ -16,4 +16,17 @@ Appsignal.configure do |config| end ``` -It is not possible to configure multiple environments in the `config/appsignal.rb` config file as it was possible in the YAML version. +To configure different option values for environments in the `config/appsignal.rb` config file, use if-statements: + +```ruby +# config/appsignal.rb +Appsignal.configure do |config| + config.name = "My app name" + if config.env == "production" + config.ignore_actions << "My production action" + end + if config.env == "staging" + config.ignore_actions << "My staging action" + end +end +```