Merge branch 'dev'

This commit is contained in:
gregoirenovel 2018-03-05 10:18:37 +01:00
commit f536cc7970
5 changed files with 27 additions and 15 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

@ -93,6 +93,7 @@ GEM
momentjs-rails (~> 2.8)
sass-rails (~> 5.0)
selectize-rails (~> 0.6)
aes_key_wrap (1.0.1)
apipie-rails (0.5.6)
rails (>= 4.1)
archive-zip (0.11.0)
@ -114,8 +115,8 @@ GEM
sass (>= 3.3.4)
bootstrap-wysihtml5-rails (0.3.3.8)
railties (>= 3.0)
brakeman (4.1.1)
browser (2.5.2)
brakeman (4.2.0)
browser (2.5.3)
builder (3.2.3)
byebug (10.0.0)
capybara (2.18.0)
@ -137,7 +138,7 @@ GEM
carrierwave-i18n (0.2.0)
case_transform (0.2)
activesupport
chartkick (2.2.5)
chartkick (2.3.2)
childprocess (0.8.0)
ffi (~> 1.0, >= 1.0.11)
chromedriver-helper (1.2.0)
@ -424,8 +425,9 @@ GEM
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.1.0)
json-jwt (1.8.3)
json-jwt (1.9.2)
activesupport
aes_key_wrap
bindata
securecompare
url_safe_base64
@ -511,10 +513,9 @@ GEM
oauth2 (~> 1.1)
omniauth (~> 1.2)
open4 (1.3.4)
openid_connect (1.1.4)
openid_connect (1.1.5)
activemodel
attr_required (>= 1.0.0)
json (>= 1.4.3)
json-jwt (>= 1.5.0)
rack-oauth2 (>= 1.6.1)
swd (>= 1.0.0)
@ -522,7 +523,7 @@ GEM
validate_email
validate_url
webfinger (>= 1.0.1)
openstack (3.3.15)
openstack (3.3.17)
json
orm_adapter (0.5.0)
parallel (1.12.1)
@ -549,11 +550,11 @@ GEM
rack
rack-mini-profiler (0.10.7)
rack (>= 1.2.0)
rack-oauth2 (1.8.2)
rack-oauth2 (1.9.0)
activesupport
attr_required
httpclient
json-jwt
json-jwt (>= 1.9.0)
rack
rack-protection (2.0.1)
rack
@ -671,9 +672,9 @@ GEM
scenic (1.4.1)
activerecord (>= 4.0.0)
railties (>= 4.0.0)
scss_lint (0.56.0)
scss_lint (0.57.0)
rake (>= 0.9, < 13)
sass (~> 3.5.3)
sass (~> 3.5.5)
securecompare (1.0.0)
select2-rails (4.0.3)
thor (~> 0.14)

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

View file

@ -0,0 +1,11 @@
namespace :'2018_02_28_clean_invalid_emails_accounts' do
task clean: :environment do
Gestionnaire.pluck(:email, :id).select { |e, id| e.include?(" ") }.each do |email, id|
Gestionnaire.find_by(id: id, current_sign_in_at: nil).try(:destroy) # ensure account was never used
end
User.pluck(:email, :id).select { |e, id| e.include?(" ") }.each do |email, id|
User.find_by(id: id, current_sign_in_at: nil).try(:destroy) # ensure account was never used
end
end
end