rails/rails — pull request #12468 by Bantik (2013-10-08 16:14:58+00:00)
Title: Add exclude_nils option to as_json.

`as_json` now accepts a `exclude_nils` option to
skip nil attributes in the resulting JSON output.
This option peacefully coexists with the `except`
and `include` options.