Skip to content

Commit

Permalink
Update deprecation_warning_subscriber.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandEdara authored Aug 14, 2023
1 parent 93eab40 commit 50bf09f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config/initializers/deprecation_warning_subscriber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,14 @@ def emit_warning_to_slack_alerts_channel(event)
.new(url: ENV["SLACK_DISPATCH_ALERT_URL"])
.send_notification(event.payload[:message], slack_alert_title, SLACK_ALERT_CHANNEL)
end

def raise_if_fixed_deprecation_triggered(event)
# Checking for deprecated message in development and test environments
if Rails.env.development? || Rails.env.test?
if event.payload[:message].include?("The success? predicate is deprecated")
message = "Fixed deprecation warning triggered: #{event.payload[:message]}"
raise DeprecationWarning, message
end
end
end
end

0 comments on commit 50bf09f

Please sign in to comment.