Commit Graph

23 Commits

Author SHA1 Message Date
Javi Martín
15f7632f3d Refactor notifiable_available? method
This method was calling `check_availability`, which returned a boolean
value and caused a `Naming/PredicateMethod` when upgrading rubocop.

So we're changing the logic a little bit to remove the
`check_availability` method and merge the tests of `check_availability`
and `notifiable_available?` (which were almost identical) together.
2025-11-05 14:27:11 +01: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
47b2c42a1d Apply IndentationConsistency rubocop rule 2019-09-10 20:02:15 +02:00
Senén Rodero Rodríguez
ce7be5f2d6 Change the way to retrieve notifiable body
Using 'try' method to get notifiable is not working with translations
anymore. It was returning 'nil' always even when body translation is
populated.
2019-06-27 09:19:36 +02:00
Juanjo Bazán
b7d9ef6377 models inherits from ApplicationRecord 2019-04-17 17:40:56 +02:00
María Checa
b7a1599fdf Adds logic to send proposal notifications in batches
WIP batches tests
2018-07-26 17:55:06 +02:00
Bertocq
4a5235f96f Allow notifications with explicit/unexistent links
Notifications usually link to the associated notifiable, but the new
AdminNotifications have a link attribute that may be empty or contain an
external or internal url.
2018-07-25 18:31:41 +02:00
rgarcia
09c44ee583 Extend notifications to be marked as read and unread 2018-03-23 11:47:06 +01:00
rgarcia
2b52d26d82 refactors notifications into concerns and shared examples 2017-12-14 16:15:30 +01:00
Bertocq
2888c20489 Fix all Style/RedundantSelf rubocop issues 2017-07-05 11:55:52 +02:00
Bertocq
775da2d581 Remove all Layout/EmptyLines issues on code and file list from rubocop_todo 2017-06-28 14:12:51 +02:00
Bertocq
21c6d1c4dd Cleanup Lint/AssignmentInCondition rubocop issues on code and remove it from ruboco_todo list 2017-06-19 10:45:18 +02:00
rgarcia
bb3c4c6399 adds consistency to ruby code style
Keep a blank line before and after private
Keep a blank line before and after protected
Remove extra empty line at class body end
Remove extra blank line
Add final newline
Use 2 (not 3) spaces for indentation
Use 2 (not 4) spaces for indentation
Remove space before comma
Add space after comma
Remove trailing whitespaces
Remove unnecessary spacing
Use snake_case for variable names
Do not use then for multi-line if
Remove unused block argument - i
Use the new Ruby 1.9 hash syntax
Remove unused assignment to variable
Indent when as deep as case
Align attributes
Align end with def
2016-11-15 11:18:43 +01:00
rgarcia
b087fe8fb7 refactors email digest 2016-08-03 19:33:37 +02:00
rgarcia
e2689d640c refactors notification helpers 2016-06-15 12:12:56 +02:00
rgarcia
a0ddde16e9 adds notifications for proposals 2016-06-07 22:03:14 +02:00
Juanjo Bazán
432e9e0d5b adds counter cache for user's notifications 2016-01-08 14:39:34 +01:00
Juanjo Bazán
704a038795 groups notifications 2016-01-08 14:32:16 +01:00
rgarcia
e2f419e625 destroy notifications when marked as read 2016-01-07 12:02:01 +01:00
rgarcia
b5e9113718 merges activities into notifications 2016-01-06 12:33:37 +01:00
Julian Herrero
9a5f525dc9 marcar notificaciones como leidas despues de ser vistas 2016-01-05 17:43:44 +01:00
Julian Herrero
d9ba3edc2a mostrar notificaciones a los usuarios cuando alguien comenta en su
debate o responde a su comentario
2016-01-05 17:43:44 +01:00