Files
openfoodnetwork/app/models
Maikel Linke 61797fff56 Restrict deletion of address explicitely
Enterprises have an `address_id` which must point to a valid
`Spree::Address`. As Rubocop suggested, I restricted the deletion of
addresses when they are still associated to an enterprise.

Without declaring `dependent: :restrict`, trying to delete the address
would raise `ActiveRecord::InvalidForeignKey`. Now it is more specific
and raises `ActiveRecord::DeleteRestrictionError`.

I didn't find code rescuing the InvalidForeignKey when deleting addresses. I
actually think that we never delete addresses. So this change should not
have any impact on the execution.
2018-10-16 15:18:44 +11:00
..
2017-12-01 13:37:24 +11:00
2012-03-27 10:10:26 +11:00
2014-12-12 13:33:14 +11:00
2014-12-12 13:33:14 +11:00