Commit Graph

15 Commits

Author SHA1 Message Date
Javi Martín
0e7c3b4cc0 Remove redundant method to set order
It was being incorrectly detected as used in a dangerous send. We can
get rid of the warning by taking advantage of the `has_orders` method
and getting rid of this code.
2019-11-13 01:33:06 +01:00
Javi Martín
d0d681a44b Add and apply EmptyLineAfterGuardClause rule
We were inconsistent on this one. I consider it particularly useful when
a method starts with a `return` statement.

In other cases, we probably shouldn't have a guard rule in the middle of
a method in any case, but that's a different refactoring.
2019-10-24 17:56:03 +02:00
Javi Martín
47b2c42a1d Apply IndentationConsistency rubocop rule 2019-09-10 20:02:15 +02:00
Javi Martín
b5b07bccd3 Apply PercentLiteralDelimiters rubocop rule 2019-09-10 20:02:15 +02:00
Julian Herrero
d24376f6ad Use double quotes in controllers/ 2019-03-13 22:19:49 +01:00
Bertocq
e59ed81528 Return 404 accesing community without communitable
Why:

Somehow we're seeing communities without proposals at production. We
must find why and fix it, but first we need to throw a 404 at the user
instead of a 500 internal server error

How:

First catching the scenario of non-existent communitable at the
controller and raising a 404 error. Secondly preventing the author_id
access over a possibly nil object, this is a smell but it can't be
easily fixed right now... we need to correctly implement a relation
between Community and communitable and avoid the multiple occurences of
`community.from_proposal?` in the codebase that makes it impossible to
extend to a fourth communitable model.
2018-01-23 00:22:53 +01:00
Bertocq
e4e78c8f16 Rubocop autocorrections 2017-09-14 15:08:35 +02:00
taitus
5ea16976f7 Refactor communities controller. Add missing specs on topics order. 2017-09-06 12:34:38 +02:00
taitus
5d22558c2b Fix specs 2017-09-05 12:54:32 +02:00
taitus
e1a7f9c58c Add community to Global Settings 2017-09-05 12:54:32 +02:00
taitus
54cf210b07 Fix rebase with master. 2017-09-05 12:53:37 +02:00
taitus
4539c5fa00 Refactor and tests. 2017-09-05 12:52:14 +02:00
taitus
a1d37fa6c4 Add order on topic index. 2017-09-05 12:51:08 +02:00
taitus
1dc3cd4bb3 Add paginate to topics 2017-09-05 12:51:08 +02:00
taitus
43c17c3fc7 Add communities and topics 2017-09-05 12:51:08 +02:00