Commit Graph

44 Commits

Author SHA1 Message Date
Julian Herrero
3ba961a2d7 Use double quotes in models 2019-03-14 17:25:43 +01:00
Bertocq
633cc1283b Fix Date & DateTime parsings to use default timezone
Date.new(...) does not take into account the current timezone, while other
parts of the application do. By default always parsing any date with the
default timezone and converting the resulting Time to Date would prevent
this kind of issues

DateTime.parse(...).in_time_zone gives an unexpected result, as the
DateTime.parse(...) will create a DateTime with +0000 time zone and the
`in_time_zone` will modify the DateTime to adjust to the default zone.

Maybe its better explained with an example, using 'Lima' as timezone:

DateTime.parse("2015-01-01")
> Thu, 01 Jan 2015 00:00:00 +0000

DateTime.parse("2015-01-01").in_time_zone
> Wed, 31 Dec 2014 19:00:00 -05 -05:00

And that's not the desired date but the previous day!
2018-04-04 14:21:39 +02:00
María Checa
d576fd5951 Merge branch 'master' into 1725-census_local_copy_user_verification 2017-07-14 15:50:26 +02:00
Bertocq
69f4e1c683 Fix all rubocop Metrics/LineLength issues (140+) 2017-07-10 13:22:49 +02:00
María Checa
089c690b49 Created new entry point CensusCaller
Here's a better alternative than the first one. Added a new abstraction level from which are performed both types of census calls, while the logic of those is managed in their own library.
2017-07-10 12:22:30 +02:00
María Checa
7e701db608 Added new census data source to Verification::Residence
Adapted model to perform a query to find a `LocalCensusRecord` record in case the census API is not available or returns invalid data.
2017-07-08 20:39:05 +02:00
Bertocq
2888c20489 Fix all Style/RedundantSelf rubocop issues 2017-07-05 11:55:52 +02:00
Bertocq
2fa92937d2 Fix all Style/BracesAroundHashParameters rubocop issues and remove them from rubocop_todo list 2017-06-28 14:12:51 +02:00
Bertocq
d7b8777395 Fix all Layout/SpaceAroundEqualsInParameterDefault rubocop issues from rubocop_todo list 2017-06-26 18:03:40 +02:00
Bertocq
8d84ed712a Fix all Rails/Validation rubocop issues and remove files from rubocop_todo list 2017-06-25 15:46:46 +02:00
Bertocq
02524b164a Rubocop autocorrections (indentations, revers unless to if, extra spaces) 2017-06-08 12:14:35 +02:00
Juanjo Bazán
590a7bce44 reassigns erased user votes when returning user is verified 2017-02-09 20:20:30 +01:00
kikito
386a5aa941 Fixes typos 2017-02-03 16:08:58 +01:00
kikito
ba87eaa47c Moves Age calculation to a module instead of monkeypatching Date 2017-02-03 15:35:41 +01:00
kikito
95f80651b1 uses Date#age_in_years when calculating ages 2017-02-03 12:56:40 +01:00
Juanjo Bazán
e2118f701b removes hardcoded age, favours setting 2017-01-09 16:05:27 +01:00
kikito
f0b8cfd4a2 Time.now -> Time.current 2016-11-23 19:19:19 +01:00
Andrés Pereira
24a9d77e64 Custom folder structure: verification residence for Madrid 2016-05-31 19:57:37 +02:00
kikito
1b1f2bc2c9 renames genre to gender in code 2016-04-13 14:27:27 +02:00
kikito
7987a3410b Updates residence to handle CensusAPI's new response 2016-04-12 18:19:05 +02:00
kikito
2c51115d6d Residence Verification now fills up the date of birth and genre 2016-04-12 13:38:39 +02:00
rgarcia
ad3bf7f573 removes unused code 2016-02-22 21:33:08 +01:00
rgarcia
0e33382912 adds hot fix for census api failed attempt storage 2016-02-22 11:36:48 +01:00
kikito
20041a9893 removes bang method 2016-02-19 18:37:36 +01:00
kikito
06bd44c225 Fixes errors on verification/residence specs 2016-02-19 18:29:14 +01:00
kikito
f471503f35 Adds geozone to verification::residence 2016-02-19 18:29:14 +01:00
kikito
cc1a69c7a5 fixes error in census_api and refactors constructor 2015-09-30 10:56:57 +02:00
kikito
1c372328d9 Refactor in residence verification + census api
Needed for a new census api verification using only the document type
(no date of birth and no postal code)
2015-09-29 20:18:52 +02:00
rgarcia
1dee45337b fixes specs 2015-09-23 21:08:21 +02:00
rgarcia
1d1b7b86d2 adds validation for postal codes in Madrid 2015-09-23 20:54:56 +02:00
rgarcia
1a6ee424d0 refactors postal code validation 2015-09-23 20:09:39 +02:00
rgarcia
6ccef97d4e adds valid postal codes 2015-09-23 12:34:19 +02:00
Juanjo Bazán
1f42fba8ec adds validation for allowed age 2015-09-16 18:00:49 +02:00
Juanjo Bazán
46612bd01e cleans document number before residence check 2015-09-16 17:24:29 +02:00
Juanjo Bazán
fe9241c81b adds i18n to residence document error 2015-09-16 17:24:06 +02:00
rgarcia
abc68dc868 refactors lock tries [#279] 2015-09-10 20:26:49 +02:00
rgarcia
664852ce4e refactors storing of failed attempt [#277] 2015-09-10 20:16:49 +02:00
rgarcia
547b7afc6b stores failed Census API calls [#277] 2015-09-10 18:00:23 +02:00
Juanjo Bazán
e3449723b3 Merge pull request #370 from AyuntamientoMadrid/verified_users
Verified users
2015-09-06 11:35:56 +02:00
rgarcia
cbd4e30e80 fixes specs 2015-09-06 11:15:24 +02:00
rgarcia
34218d112b increases residence verification tries after a Census call 2015-09-05 23:57:47 +02:00
rgarcia
2260de9451 uppercases document number 2015-09-05 23:04:13 +02:00
rgarcia
9abd794133 validates acceptance of census terms of service 2015-08-30 12:50:17 +02:00
Juanjo Bazán
e8463d1372 moves Residence model to Verification namespace 2015-08-29 12:38:07 +02:00