Commit Graph

24 Commits

Author SHA1 Message Date
Javi Martín
32b1fc53e1 Add and appy MultilineOperationIndentation rule
This way it's easier to see when lines are part of multiline
statements and when they belong to `if` statements.
2023-08-18 14:56:16 +02:00
Javi Martín
7212657c02 Remove Paperclip and use just Active Storage 2022-02-23 18:43:48 +01:00
Javi Martín
091abfc944 Use Active Storage to render attachments
This way we fix a bug we mentioned in commit 930bb753c which caused
links to documents to be broken when editing their title because the
title was used to generate the URL of the document.

Note we're still using Paperclip to render cached attachments because
this is the only case where we store files with just Paperclip and not
Active Storage.

With Active Storage, we render attachments just like any other resource,
using `polymorphic_path`. Paperclip included the `url` method in the
model; since the model doesn't have access to the request parameters
(like the host), this was inconvenient because it wasn't possible to
generate absolute URLs with Paperclip.

In order to simplify the code and make it similar to the way we used
Paperclip, we're adding a `variant` method accepting the name of a
variant and returning the variant.
2022-02-23 18:21:38 +01:00
Javi Martín
99bbad9b1e Add and apply Style/RedundantCondition rule
This is a rule we generally follow all the time but accidentally forgot
in one place.
2021-08-09 19:21:31 +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
38b7307450 Use respond_to? instead of try
Usually when we use `try` we actually mean `try!`, which is the same as
the safe navigation operator. However, there are a few cases where we
actually mean to execute a method if the object responds to that method.

In those cases using `try` would actually be OK, but in order to avoid
confusion as to whether we mean to check for `respond_to?` or we mean to
use safe navigation, I'm removing all usages of `try`.
2019-10-22 17:37:51 +02:00
Javi Martín
4e72d9f3b7 Remove useless assignments to return values 2019-09-25 12:43:44 +02:00
Javi Martín
e252d82cdb Apply IndentationWidth rubocop rule 2019-09-10 20:02:15 +02:00
Julian Herrero
b460c024f3 Use double quotes in app/helpers 2019-03-15 09:26:49 +01:00
decabeza
0bf31bde6c Updates all active to is-active classes 2018-06-06 12:02:13 +02:00
Bertocq
7b40c84166 Rubocop fixes and rubocop todo update for those that can't be done right now 2017-10-17 22:23:53 +02:00
Bertocq
ce0a7f6fad Rubocop autocorrections 2017-10-17 22:00:00 +02:00
decabeza
599c243f62 removes unnecessary helper for welcome page 2017-10-13 18:58:58 +02:00
Senén Rodero Rodríguez
92c774cdeb Merge with master 2017-09-28 13:36:20 +02:00
taitus
b4a6f664bb Remove image by default on carousel. Remove duplicate code. Add background when user recomendations is actived 2017-09-05 19:11:32 +02:00
taitus
52e3610876 Minimum required by consul core. Remove comments. Fix texts. Decrease size of methods. 2017-08-02 00:15:03 +02:00
taitus
11395e0b27 Remove old code. Add whitespaces. 2017-08-01 16:48:42 +02:00
taitus
c6a9ffc19c Remove recommended investments 2017-08-01 16:28:01 +02:00
taitus
b6d5be3df0 Rename dynamic display to carousel size 2017-08-01 16:28:01 +02:00
taitus
ee0a10855d Calculate carousel size. 2017-08-01 16:28:01 +02:00
taitus
fd8e2c1503 Allow to display images on carousel partial. 2017-08-01 16:28:01 +02:00
taitus
f8c6422b30 Testing links on carousel. Improve tests descripions 2017-08-01 16:28:01 +02:00
taitus
522c4e2cfc Regroup all carousels on 1 partial. Rename partial 2017-08-01 16:28:01 +02:00
taitus
ff6471982c Add recommended debates, proposals and investement to Home page. 2017-08-01 15:48:21 +02:00