Commit Graph

6 Commits

Author SHA1 Message Date
Javi Martín
8b13daad95 Add and apply rules for multi-line hashes
For the HashAlignment rule, we're using the default `key` style (keys
are aligned and values aren't) instead of the `table` style (both keys
and values are aligned) because, even if we used both in the
application, we used the `key` style a lot more. Furthermore, the
`table` style looks strange in places where there are both very long and
very short keys and sometimes we weren't even consistent with the
`table` style, aligning some keys without aligning other keys.

Ideally we could align hashes to "either key or table", so developers
can decide whether keeping the symmetry of the code is worth it in a
case-per-case basis, but Rubocop doesn't allow this option.
2023-08-18 14:56:16 +02:00
Senén Rodero Rodríguez
a150f2161e Validate inclusion of document type in allowed document types
* Add custom message for inclusion validation to include the allowed values.
* Force user to choose document_type from select lik the one shown at verification form.
* Convert stored document_type to a human readable text
2019-11-07 16:26:19 +01:00
Javi Martín
fd1325768f Check exact array contents instead of inclusion
We're using `eq` and `match_array` in most places, but there were a few
places where we were still checking each element is included in the
array. This is a bit dangerous, because the array could have duplicate
elements, and we wouldn't detect them with `include`.
2019-09-29 23:57:35 +02:00
Senén Rodero Rodríguez
3c39dccad4 Add uniqueness validation to document_number and document_type pair 2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
d1587ecc62 Add sanitization to clear trailing whitespaces 2019-07-29 13:07:24 +02:00
Senén Rodero Rodríguez
f071ca6cb5 Create LocalCensusRecords index page
* Create admin controller and routes
* Add pagination
* Add search by document_number
* Add EN and ES translations
* Add index specs
* Add missing model specs
2019-07-29 13:07:24 +02:00