Files
grecia/spec/models
Javi Martín a0942f66bf Fix crash destroying budgets with admins/valuators
We don't allow deleting a budget with associated investments. However,
we allow deleting a budget with associated administrators and valuators.
This results in a foreign key violation error:

PG::ForeignKeyViolation: ERROR:  update or delete on table "budgets"
violates foreign key constraint "fk_rails_c847a52b1d" on table
"budget_administrators"

Using the `dependent: :destroy` option when defining the relationship,
we remove the association records when removing the budget.

As a bonus, we reduce the number of Rubocop offenses regarding the
`Rails/HasManyOrHasOneDependent` rule. Only 72 to go! :)
2021-06-02 17:07:04 +02:00
..
2020-12-21 18:04:48 +01:00
2021-05-29 14:18:31 +02:00
2019-05-31 18:22:59 +02:00
2019-03-27 15:22:14 +01:00