Commit Graph

31 Commits

Author SHA1 Message Date
Javi Martín
a1439d0790 Apply Layout/LineLength rubocop rule
Note we're excluding a few files:

* Configuration files that weren't generated by us
* Migration files that weren't generated by us
* The Gemfile, since it includes an important comment that must be on
  the same line as the gem declaration
* The Budget::Stats class, since the heading statistics are a mess and
  having shorter lines would require a lot of refactoring
2023-08-30 14:46:35 +02:00
Javi Martín
eafb4018bf Apply Style/CollectionMethods rubocop rule
We were already using `map` and `reduce` almost everywhere.
2019-10-26 13:03:49 +02:00
Javi Martín
d0d681a44b Add and apply EmptyLineAfterGuardClause rule
We were inconsistent on this one. I consider it particularly useful when
a method starts with a `return` statement.

In other cases, we probably shouldn't have a guard rule in the middle of
a method in any case, but that's a different refactoring.
2019-10-24 17:56:03 +02:00
Javi Martín
db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00
Javi Martín
93c6347b45 Apply Rails/FindBy rubocop rule
We were already using it in most places.
2019-10-23 18:29:09 +02:00
Javi Martín
49c3402833 Use update! instead of update_attributes!
It's what we use almost everywhere, and it's shorter.
2019-10-23 14:39:31 +02:00
Javi Martín
1004ac01f8 Add and apply Style/SafeNavigation rubocop rule
We were already using it most of the time, but not always.
2019-10-22 17:37:51 +02:00
Javi Martín
b5b07bccd3 Apply PercentLiteralDelimiters rubocop rule 2019-09-10 20:02:15 +02:00
taitus
626d2b3c2b Allow to Signature works with CustomCensusAPI
- Send new fields to CensusCaller call method to
  allow use on CustomCensusAPI
2019-07-29 13:10:09 +02:00
taitus
5d68e1a43d Add new fields to signature
- Add :date_of_birth and :postal_code to Signature to allow send these
  fields to CustomCensusAPI

- Add new model presence validates: Only validate :date_of_birth and
  :postal_code presence when the application has configured Remote Census
  and their alias fields has values.
2019-07-29 13:10:09 +02:00
taitus
a382f7c301 Update all CensusCaller calls with new arguments. 2019-07-29 13:10:09 +02:00
Juanjo Bazán
7ab602175a makes models inherit from ApplicationRecord 2019-04-17 17:40:56 +02:00
Julian Herrero
3ba961a2d7 Use double quotes in models 2019-03-14 17:25:43 +01:00
María Checa
d576fd5951 Merge branch 'master' into 1725-census_local_copy_user_verification 2017-07-14 15:50:26 +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
Bertocq
2888c20489 Fix all Style/RedundantSelf rubocop issues 2017-07-05 11:55:52 +02:00
Alberto
6bbcc71ecb Merge branch 'master' into polls 2017-04-06 14:16:49 +02:00
Juanjo Bazán
83e2df7410 adds signature sheets for budget investments 2017-04-05 12:59:42 +02:00
Juanjo Bazán
12c00a714d adds demographic info to signature users 2017-04-05 11:31:56 +02:00
Juanjo Bazán
098a271d7c Merge branch 'master' into polls 2016-12-28 20:55:58 +01:00
rgarcia
25f34cdab9 Only stores alphanumeric characters of a signature's document number 2016-12-28 20:01:17 +01:00
Juanjo Bazán
ab61d94d2d changes Time.now to Time.current 2016-12-27 18:26:03 +01:00
rgarcia
316f9a0370 creates users with email nil to avoid index constraint 2016-12-26 14:28:45 +01:00
rgarcia
5281bb8181 fixes typo 2016-12-26 12:59:23 +01:00
rgarcia
c1b06b6501 creates user without email nor username 2016-12-26 12:45:48 +01:00
rgarcia
42b0ff2696 optimize census call to return after finding a valid element 2016-12-26 11:51:28 +01:00
rgarcia
ddeca6f06d fixes specs 2016-12-23 19:05:25 +01:00
rgarcia
675081141c refactors signatures 2016-12-21 18:46:31 +01:00
rgarcia
b10dbd7cb5 adds specs 2016-12-20 18:00:36 +01:00
rgarcia
4eb700e3d4 refactors signature sheets 2016-12-20 16:46:08 +01:00
rgarcia
3c682b8a9b adds signature sheets 2016-12-20 12:21:05 +01:00