-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some of the errors in rollbar are tricky to debug as we don't know what answers the claimant provided. This commit adds a mechanism for flagging attributes as PII and updates the ClaimsController to include the non pii attributes in the Rollbar scope such that they are available in Rollbar.
- Loading branch information
Showing
6 changed files
with
74 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module Journeys | ||
module Sessions | ||
module PiiAttributes | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
class_attribute :pii_attributes, default: [], instance_writer: false | ||
end | ||
|
||
class_methods do | ||
def attribute(name, type = nil, **options) | ||
pii_attributes << name if options.delete(:pii) | ||
super | ||
end | ||
end | ||
|
||
def attributes_with_pii_redacted | ||
attributes.map do |key, value| | ||
if pii_attributes.include?(key.to_sym) && value.present? | ||
[key, "[PII]"] | ||
else | ||
[key, value] | ||
end | ||
end.to_h | ||
end | ||
end | ||
end | ||
end |
This file contains 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
This file contains 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
This file contains 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
This file contains 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