diff options
author | Steve Klabnik <steve@steveklabnik.com> | 2012-09-15 16:22:15 +0400 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2012-09-15 16:35:34 +0400 |
commit | afe96542977ed52d0e80164b5079b3e5541fdcdb (patch) | |
tree | e5c9bfc183d87c77b040c778a632741016774cec /activesupport | |
parent | 60c88e64e26682a954f7c8cd6669d409ffffcc8b (diff) | |
download | rails-afe96542977ed52d0e80164b5079b3e5541fdcdb.tar.gz rails-afe96542977ed52d0e80164b5079b3e5541fdcdb.tar.bz2 rails-afe96542977ed52d0e80164b5079b3e5541fdcdb.zip |
Improve Process::Status#to_json
Because Process::Status has no instance_variables, the
ActiveSupport version of #to_json produces {}, which isn't good.
Therefore, we implement our own #as_json, which makes it useful
again.
Fixes #4857
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/to_json.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/to_json.rb b/activesupport/lib/active_support/core_ext/object/to_json.rb index e7dc60a612..83cc8066e7 100644 --- a/activesupport/lib/active_support/core_ext/object/to_json.rb +++ b/activesupport/lib/active_support/core_ext/object/to_json.rb @@ -17,3 +17,11 @@ end end end end + +module Process + class Status + def as_json(options = nil) + { :exitstatus => exitstatus, :pid => pid } + end + end +end |