Skip to content

Commit e748124

Browse files
committed
refactor(active_job): simpler allowlist calc
1 parent 3c9eeda commit e748124

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

sentry-rails/lib/sentry/rails/active_job.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ def serialize
3939

4040
if Sentry.configuration.send_default_pii
4141
user = Sentry.get_current_scope.user
42-
allowed = user.each_with_object({}) do |(k, v), acc|
43-
acc[k.to_s] = v if USER_FIELDS_ALLOWLIST.include?(k.to_s)
44-
end
42+
allowed = user.transform_keys(&:to_s).slice(*USER_FIELDS_ALLOWLIST)
4543
sentry_data["user"] = allowed unless allowed.empty?
4644
end
4745

0 commit comments

Comments
 (0)