Files
grecia/app/components/admin
Javi Martín 95f36ed52f Simplify code to toggle investment selection
This way it'll be easier to change the link/button used to toggle the
selection.

Note that the conditions in the view seem to be different because we no
longer include the `selected?` condition when rendering the link/button.
However, an investment can only be selected if it's feasible and its
valuation is finished, so writing something like this would have been
redundant:

```ruby
can?(:toggle_selection, investment) &&
  (selected? || investment.feasible? && investment.valuation_finished?)
```

The reason why the previous code was using the `selected?` condition was
to check whether to render the link/button to select or to deselect an
investment. We're now doing that in the Ruby part of the component.
2024-10-28 13:39:42 +01:00
..
2024-05-09 14:28:32 +02:00