sozialhelden / wheelmap-classic

:wheelchair: Legacy "classic" wheelmap.org (deprecated)
http://www.wheelmap.org
GNU Affero General Public License v3.0
46 stars 16 forks source link

Change date_time validation from regex to DateTime parser #635

Closed 1000miles closed 7 years ago

1000miles commented 7 years ago

When executing the PR #634 on production we noticed that this string 2017-02-04 21:05:15 +0000 was not recognized as a valid string.

Error Example

osm_id: 21302157
EXIF date_time format '2017-02-04 21:05:15 +0000' is not supported: no implicit conversion of Time into String

Even though this was fixed by using to_s on date_time, we decided to refactor the current validation to be on the safe side for the future. Luckily the DateTime parser would parse most of the date_time formats we need for now.

Allowed date_time formats:

This is a follow-up PR of PR #634 and part of Github issue #633.

1000miles commented 7 years ago

Thaaaaank you for review, @justahero ! 🍰

1000miles commented 7 years ago

Deployed to production today: https://github.com/sozialhelden/wheelmap/releases/tag/production-20170710114323