Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-2950

Epoch and invalid date times

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.1.3
    • Component/s: None
    • Labels:
      None

      Description

      Hi,

      Since commit: https://github.com/mongoid/mongoid/commit/6f839e8a4c4bba361b8c774ddbc7b648b70fcb89

      All invalid date times will return the Epoch instead of an error. What was the reasoning behind moving to setting a default EPOCH time instead of raising an error?

      If a user manages to pass in an incorrectly formatted string for a date/time field, the resulting value will be the EPOCH. This could lead to inconstancies when the user assumes that the data was set correctly (i.e. no error) but the EPOCH time value is actually stored.

      I know my app has a date time form field that the user can set through a datetime picker but they can also manipulate the input string possibly creating an invalid time string that ::Time.parse(self) will fail on resulting in the field being set to the EPOCH.

      Thoughts appreciated.
      Cam

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            camallen camallen
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: