Files
nairobi/app/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
..
2021-03-02 13:15:15 +01:00
2021-03-02 13:15:15 +01:00
2020-10-15 14:57:42 +02:00
2021-01-14 17:37:58 +01:00
2020-12-16 11:43:17 +01:00
2021-04-08 17:23:30 +02:00
2020-10-15 14:57:42 +02:00
2021-04-13 13:52:18 +02:00
2020-12-15 11:57:09 +01:00
2020-12-21 18:04:48 +01:00
2020-12-02 12:13:02 +01:00
2020-04-09 07:11:53 +10:00
2021-01-12 14:50:37 +01:00