-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
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