« Previous | Next » 

Revision 00d95f0f

ID00d95f0f330799a816214f3f329f8d8cf7e2a447
Parent 19dcf1ed
Child 353eb4f4

Added by Tom Clegg 8 months ago

6347: Use RFC3339Nano to render timestamps loaded from serialized fields.

Psych (YAML) serializes timestamps as ISO8601-with-space-separators,
and safe_load deserializes them to Time even with
whitelist_classes=[].

Psych.dump(Time.now.utc)
=> "--- 2017-02-22 21:33:22.845133778 Z\n...\n"

Psych.safe_load('2017-02-22 21:33:22.845133778 Z').class
=> Time

Psych.safe_load('2017-02-31 21:33:22.845133778 Z').class
=> String

Before:

Psych.safe_load('2017-02-22 21:33:22.845133778 Z').as_json
=> "2017-02-22T21:33:22Z"

After:

Psych.safe_load('2017-02-22 21:33:22.845133778 Z').as_json
=> "2017-02-22T21:33:22.845133778Z"

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences