Merge pull request #1248 from betagouv/bump-ruby

Bump ruby to 2.5.0
This commit is contained in:
gregoirenovel 2018-03-02 15:54:34 +01:00 committed by GitHub
commit 072ad932eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -3,7 +3,7 @@ version: 2
defaults: &defaults
working_directory: ~/tps
docker:
- image: circleci/ruby:2.3.6-node-browsers
- image: circleci/ruby:2.5.0-node-browsers
- image: circleci/postgres:9.5
environment:
POSTGRES_USER: tps_test

View file

@ -1 +1 @@
2.3.6
2.5.0

View file

@ -153,9 +153,9 @@ class Champ < ActiveRecord::Base
nil
end
self.value = date
elsif /^\d{2}\/\d{2}\/\d{4}\s\d{2}:\d{2}$/ =~ value # old browsers can send with dd/mm/yyyy hh:mm format
elsif /^\d{2}\/\d{2}\/\d{4}\s\d{2}:\d{2}$/.match?(value) # old browsers can send with dd/mm/yyyy hh:mm format
self.value = DateTime.parse(value, "%d/%m/%Y %H:%M").strftime("%Y-%m-%d %H:%M")
elsif !(/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/ =~ value) # a datetime not correctly formatted should not be stored
elsif !(/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/.match?(value)) # a datetime not correctly formatted should not be stored
self.value = nil
end
end