Commit Graph

4 Commits

Author SHA1 Message Date
Javi Martín
bc18a6e10e Remove unused url method in poll question answers
This method would never work because it relies on the `image`
association, instead of the `images` association defined in the
`Galleryable` module.
2021-09-24 16:36:35 +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
Julian Herrero
c9752e94be Change the way we retrireve the images urls
For some reason the paperclip method `attachment.exists?' was
returning nil even when `attachment.url(style)' was correctly
returning the url/path of the attachment.

Therefore returning `nil' was causing to raise an error in the
method `image_tag'.

With this change we make sure we return the image url it it's
available, or an empty string if it's not, but never a null value.
2019-04-17 17:40:56 +02:00
rgarcia
1cf9bc4ad1 adds images to anwers 2017-10-04 23:56:09 +02:00