aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib/active_job
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2014-12-05 11:05:15 -0200
committerDavid Heinemeier Hansson <david@loudthinking.com>2014-12-05 11:05:15 -0200
commitad4935f12745e36c70f7fe15e920371a7f107f2a (patch)
tree75bbb18243b4b10f30908cc4fec207f72b1cb7f8 /activejob/lib/active_job
parent95ddfc4e5840ca88e559157ca105e0042eb5942b (diff)
parente2fffbff98a3c60d3efb8d98a3554bea28dca532 (diff)
downloadrails-ad4935f12745e36c70f7fe15e920371a7f107f2a.tar.gz
rails-ad4935f12745e36c70f7fe15e920371a7f107f2a.tar.bz2
rails-ad4935f12745e36c70f7fe15e920371a7f107f2a.zip
Merge pull request #17817 from aripollak/hide-activejob-args
GlobalID objects are logged by their URI, not #inspect on the object, to prevent logging private data
Diffstat (limited to 'activejob/lib/active_job')
-rw-r--r--activejob/lib/active_job/logging.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/activejob/lib/active_job/logging.rb b/activejob/lib/active_job/logging.rb
index 21d2fda3ff..cd29e6908e 100644
--- a/activejob/lib/active_job/logging.rb
+++ b/activejob/lib/active_job/logging.rb
@@ -85,7 +85,12 @@ module ActiveJob
end
def args_info(job)
- job.arguments.any? ? " with arguments: #{job.arguments.map(&:inspect).join(", ")}" : ""
+ if job.arguments.any?
+ ' with arguments: ' +
+ job.arguments.map { |arg| arg.try(:to_global_id).try(:to_s) || arg.inspect }.join(', ')
+ else
+ ''
+ end
end
def scheduled_at(event)