Commit Graph

10 Commits

Author SHA1 Message Date
Javi Martín
a727dcc031 Apply Style/SymbolProc rubocop rule
This style is much more concise.
2019-10-26 20:10:32 +02:00
Javi Martín
42d2e5b3ad Apply Rails/InverseOf rubocop rule
Not doing so has a few gotchas when working with relations, particularly
with records which are not stored in the database.

I'm excluding the related content file because it's got a very peculiar
relationship with itself: the `has_one :opposite_related_content` has no
inverse; the relation itself is its inverse. It's a false positive since
the inverse condition is true:

```
content.opposite_related_content.opposite_related_content.object_id ==
  content.object_id
```
2019-10-25 19:29:12 +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
Bertocq
2e0dd9caea Relationable find_related_content should not be used to find, refactored to have a single purpose 2017-12-20 02:36:13 +01:00
María Checa
7d8b5838b9 Added new related contents score method 2017-12-19 13:14:12 +01:00
decabeza
dfe077a30e renames times_reported to flags_count on relationable.rb 2017-12-18 20:13:29 +01:00
Bertocq
cd021aee4b Add relationed_contents helper function on Relationable concern with spec 2017-11-29 19:02:25 +01:00
Bertocq
0482eb4098 Add report_related_content helper funcion on Relationable concern with spec 2017-11-29 19:02:25 +01:00
Bertocq
04dfc98c3f Create RelatedContent model spec to check relationable destroy 2017-11-29 19:01:50 +01:00
Bertocq
8f3769aa7d Create Relationable concern 2017-11-29 19:01:12 +01:00