Commit Graph

5 Commits

Author SHA1 Message Date
Javi Martín
584176adfa Add and apply Style/ArrayIntersect rubocop rule
The `intersect?` method has been added in Ruby 3.1, and it's more
readable than `(a & b).any?`.
2023-09-12 15:19:04 +02:00
Senén Rodero Rodríguez
fb611d91ca Fix legislation proposal crash with SDG enabled
Now we check the given record or name is a relatable instance or class
to avoid trying to render goals for records which don't have a goals
association.

Note for now we are ignoring the case where we pass a controller_path
for an unsupported class (for example, `legislation/proposals` or
`budgets/headings`) because we never use it. We might need to revisit
this case in the future.

Co-Authored-By: Javi Martín <javim@elretirao.net>
2021-01-31 14:44:53 +01:00
Javi Martín
75fc4315ba Add goal filter to advanced search 2021-01-10 15:54:23 +01:00
Javi Martín
142f9b300b Add filters by SDG to processes sidebar
It appears on every process where a tag cloud appears: debates,
proposals and budget investments.
2021-01-10 15:52:22 +01:00
Javi Martín
53af5749b9 Extract class to check SDG rendering conditions
This class provides a method which shows whether a certain process is
enabled.

Even if it uses a helper, this class is inside the models folder because
the helper it uses actually only uses model methods. We might eventually
remove/simplify this helper and cache inside the model, like we did with
I18n content translations in commit 41dba842a.
2021-01-09 14:19:00 +01:00