Merge branch 'dev'
This commit is contained in:
commit
f536cc7970
5 changed files with 27 additions and 15 deletions
|
@ -3,7 +3,7 @@ version: 2
|
||||||
defaults: &defaults
|
defaults: &defaults
|
||||||
working_directory: ~/tps
|
working_directory: ~/tps
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/ruby:2.3.6-node-browsers
|
- image: circleci/ruby:2.5.0-node-browsers
|
||||||
- image: circleci/postgres:9.5
|
- image: circleci/postgres:9.5
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: tps_test
|
POSTGRES_USER: tps_test
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2.3.6
|
2.5.0
|
||||||
|
|
23
Gemfile.lock
23
Gemfile.lock
|
@ -93,6 +93,7 @@ GEM
|
||||||
momentjs-rails (~> 2.8)
|
momentjs-rails (~> 2.8)
|
||||||
sass-rails (~> 5.0)
|
sass-rails (~> 5.0)
|
||||||
selectize-rails (~> 0.6)
|
selectize-rails (~> 0.6)
|
||||||
|
aes_key_wrap (1.0.1)
|
||||||
apipie-rails (0.5.6)
|
apipie-rails (0.5.6)
|
||||||
rails (>= 4.1)
|
rails (>= 4.1)
|
||||||
archive-zip (0.11.0)
|
archive-zip (0.11.0)
|
||||||
|
@ -114,8 +115,8 @@ GEM
|
||||||
sass (>= 3.3.4)
|
sass (>= 3.3.4)
|
||||||
bootstrap-wysihtml5-rails (0.3.3.8)
|
bootstrap-wysihtml5-rails (0.3.3.8)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
brakeman (4.1.1)
|
brakeman (4.2.0)
|
||||||
browser (2.5.2)
|
browser (2.5.3)
|
||||||
builder (3.2.3)
|
builder (3.2.3)
|
||||||
byebug (10.0.0)
|
byebug (10.0.0)
|
||||||
capybara (2.18.0)
|
capybara (2.18.0)
|
||||||
|
@ -137,7 +138,7 @@ GEM
|
||||||
carrierwave-i18n (0.2.0)
|
carrierwave-i18n (0.2.0)
|
||||||
case_transform (0.2)
|
case_transform (0.2)
|
||||||
activesupport
|
activesupport
|
||||||
chartkick (2.2.5)
|
chartkick (2.3.2)
|
||||||
childprocess (0.8.0)
|
childprocess (0.8.0)
|
||||||
ffi (~> 1.0, >= 1.0.11)
|
ffi (~> 1.0, >= 1.0.11)
|
||||||
chromedriver-helper (1.2.0)
|
chromedriver-helper (1.2.0)
|
||||||
|
@ -424,8 +425,9 @@ GEM
|
||||||
railties (>= 4.2.0)
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
json (2.1.0)
|
json (2.1.0)
|
||||||
json-jwt (1.8.3)
|
json-jwt (1.9.2)
|
||||||
activesupport
|
activesupport
|
||||||
|
aes_key_wrap
|
||||||
bindata
|
bindata
|
||||||
securecompare
|
securecompare
|
||||||
url_safe_base64
|
url_safe_base64
|
||||||
|
@ -511,10 +513,9 @@ GEM
|
||||||
oauth2 (~> 1.1)
|
oauth2 (~> 1.1)
|
||||||
omniauth (~> 1.2)
|
omniauth (~> 1.2)
|
||||||
open4 (1.3.4)
|
open4 (1.3.4)
|
||||||
openid_connect (1.1.4)
|
openid_connect (1.1.5)
|
||||||
activemodel
|
activemodel
|
||||||
attr_required (>= 1.0.0)
|
attr_required (>= 1.0.0)
|
||||||
json (>= 1.4.3)
|
|
||||||
json-jwt (>= 1.5.0)
|
json-jwt (>= 1.5.0)
|
||||||
rack-oauth2 (>= 1.6.1)
|
rack-oauth2 (>= 1.6.1)
|
||||||
swd (>= 1.0.0)
|
swd (>= 1.0.0)
|
||||||
|
@ -522,7 +523,7 @@ GEM
|
||||||
validate_email
|
validate_email
|
||||||
validate_url
|
validate_url
|
||||||
webfinger (>= 1.0.1)
|
webfinger (>= 1.0.1)
|
||||||
openstack (3.3.15)
|
openstack (3.3.17)
|
||||||
json
|
json
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
parallel (1.12.1)
|
parallel (1.12.1)
|
||||||
|
@ -549,11 +550,11 @@ GEM
|
||||||
rack
|
rack
|
||||||
rack-mini-profiler (0.10.7)
|
rack-mini-profiler (0.10.7)
|
||||||
rack (>= 1.2.0)
|
rack (>= 1.2.0)
|
||||||
rack-oauth2 (1.8.2)
|
rack-oauth2 (1.9.0)
|
||||||
activesupport
|
activesupport
|
||||||
attr_required
|
attr_required
|
||||||
httpclient
|
httpclient
|
||||||
json-jwt
|
json-jwt (>= 1.9.0)
|
||||||
rack
|
rack
|
||||||
rack-protection (2.0.1)
|
rack-protection (2.0.1)
|
||||||
rack
|
rack
|
||||||
|
@ -671,9 +672,9 @@ GEM
|
||||||
scenic (1.4.1)
|
scenic (1.4.1)
|
||||||
activerecord (>= 4.0.0)
|
activerecord (>= 4.0.0)
|
||||||
railties (>= 4.0.0)
|
railties (>= 4.0.0)
|
||||||
scss_lint (0.56.0)
|
scss_lint (0.57.0)
|
||||||
rake (>= 0.9, < 13)
|
rake (>= 0.9, < 13)
|
||||||
sass (~> 3.5.3)
|
sass (~> 3.5.5)
|
||||||
securecompare (1.0.0)
|
securecompare (1.0.0)
|
||||||
select2-rails (4.0.3)
|
select2-rails (4.0.3)
|
||||||
thor (~> 0.14)
|
thor (~> 0.14)
|
||||||
|
|
|
@ -153,9 +153,9 @@ class Champ < ActiveRecord::Base
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
self.value = date
|
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")
|
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
|
self.value = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
11
lib/tasks/2018_02_28_clean_gestionnaire_emails.rake
Normal file
11
lib/tasks/2018_02_28_clean_gestionnaire_emails.rake
Normal 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
|
Loading…
Add table
Reference in a new issue