Commit Graph

21 Commits

Author SHA1 Message Date
Javi Martín
27ed26d6f2 Remove unnecessary class names in relations
Just like we do in the Budget module, and in some places in the Poll and
Legislation modules, we don't need to specify the class name when the
name of the relation matches the name of a class in the same module.
2019-10-25 19:03:14 +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
710a1d8357 Split Poll::Booth.search in two methods
We use this method in two different scenarios. In an AJAX request, we
don't want to return every booth if the search is blank. However, in a
normal HTTP GET request, we want to return every record when the search
is empty, as we do everywhere else.

It's possible the behaviour of the AJAX call is unusual, since it
searches all booths, and not just the ones assigned to a poll. If we
changed this behaviour, we could simplify the code and remove the
`quick_search` method.
2019-10-07 14:30:39 +02:00
Javi Martín
481184e7f3 Fix accidental translations join
We added the code thinking we were ordering by the name of the poll, but
here we're actually ordering by the name of the booth.
2019-06-03 18:36:03 +02:00
Juanjo Bazán
7ab602175a makes models inherit from ApplicationRecord 2019-04-17 17:40:56 +02:00
Senén Rodero Rodríguez
596ef8d1ed Fix queries and scopes after column deletion
Some queries were accessing original column instead of the new
translatable one. This should have been causing unexpected behavior
for requests maded in a different locale than the application default.
2019-04-17 17:40:55 +02:00
decabeza
bc1679550b Remove incoming polls filter 2019-02-08 14:28:19 +01:00
Bertocq
f9458b9ef0 Show booth associated to current/recounting/incoming polls on shift management admin panel 2017-10-23 19:09:57 +02:00
Bertocq
7507f43ea8 Add helper method on Booth model to get booth assigment for a given poll 2017-10-19 21:30:31 +02:00
Bertocq
e4e78c8f16 Rubocop autocorrections 2017-09-14 15:08:35 +02:00
rgarcia
45d2fdd201 adds available booths 2017-09-08 21:59:54 +02:00
rgarcia
456429f08b adds shifts 2017-08-04 21:27:30 +02:00
Juanjo Bazán
89979e549f adds search to Booth model 2016-12-23 19:06:55 +01:00
Juanjo Bazán
45d26f6dee refactors poll::voter
now belongs_to booth_assignment instead of to booth
2016-12-06 20:20:18 +01:00
Juanjo Bazán
891516a0b9 changes officer assignments to polls via new model/relation 2016-12-06 14:33:06 +01:00
Juanjo Bazán
6419878741 fixes booth-poll relation 2016-12-02 14:24:31 +01:00
Juanjo Bazán
bd59ba3b82 adds poll/booth_assigments 2016-12-01 13:02:03 +01:00
Juanjo Bazán
9583c052f0 removes poll-booth direct association 2016-12-01 13:02:03 +01:00
rgarcia
5ba72f0fe3 assigns officers to booths 2016-11-14 13:58:00 +01:00
rgarcia
63ccac963a adds booth backend for index, show, create and edit actions 2016-11-14 13:57:16 +01:00
rgarcia
8dc7285681 validates user has not already voted 2016-11-14 13:52:38 +01:00