Last active
December 16, 2022 14:06
-
-
Save bkeepers/86957846e8e56fec6dcc1d4a6b769393 to your computer and use it in GitHub Desktop.
Flipper + BugSnag feature flags
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/flipper.rb | |
ActiveSupport::Notifications.subscribe('feature_operation.flipper') do |event| | |
operation, feature_name, result = event.payload.values_at(:operation, :feature_name, :result) | |
return unless operation == :enabled? | |
result ? Bugsnag.add_feature_flag(feature_name) : Bugsnag.clear_feature_flag(feature_name) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment