Files
grecia/app/models
Javi Martín 4355138f57 Simplify locking current user when voting
Back in commit 36e452437, we wrote:

> The `reload` method added to max_votes validation is needed because
> the author gets here with some changes because of the around_action
> `switch_locale`, which adds some changes to the current user record
> and therefore, the lock method raises an exception when trying to lock
> it requiring us to save or discard those record changes.

This happened when `current_user` didn't have a locale stored in the
database and the `current_locale` method returned the default locale.
And the test "Poll Votation Type Multiple answers" would indeed fail if
we removed the `reload` method. However, we can remove the need to
reload the record by avoiding the mentioned changes on the current user
record.

So we're changing the `User#locale` method so it doesn't modify the user
record.
2022-11-29 13:59:09 +01:00
..
2021-08-16 16:31:04 +02:00
2021-03-02 13:15:15 +01:00
2021-10-01 16:19:10 +02:00
2022-08-24 14:33:02 +02:00
2021-12-30 15:50:02 +01:00
2021-04-08 17:23:30 +02:00
2022-08-23 14:30:38 +02:00
2021-12-30 14:45:48 +01:00
2022-08-24 14:33:02 +02:00
2021-04-13 13:52:18 +02:00
2022-08-24 14:36:49 +02:00
2021-08-16 16:31:04 +02:00
2021-08-16 16:31:04 +02:00
2021-08-16 16:31:04 +02:00
2022-10-18 10:38:59 +02:00
2021-01-12 14:50:37 +01:00