aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/oid/array.rb
diff options
context:
space:
mode:
authorbogdanvlviv <bogdanvlviv@gmail.com>2018-09-16 21:52:42 +0300
committerbogdanvlviv <bogdanvlviv@gmail.com>2018-09-16 22:44:30 +0300
commitbe0d22a8e1465a4a30f262ac348edf87daee03e9 (patch)
treec39637e687bf39dc34015143881ac133812c00d6 /activerecord/lib/active_record/connection_adapters/postgresql/oid/array.rb
parent2df65b6fae6d5356ba783809a3c9a598f1539e3e (diff)
downloadrails-be0d22a8e1465a4a30f262ac348edf87daee03e9.tar.gz
rails-be0d22a8e1465a4a30f262ac348edf87daee03e9.tar.bz2
rails-be0d22a8e1465a4a30f262ac348edf87daee03e9.zip
Raise `ActiveRecord::InvalidForeignKey` in `before_destroy` for a blob if attachments exist
The issue #32584 was fixed in #33405 by adding foreign key constraint to the `active_storage_attachments` table for blobs. This commit implements fix on app-level in order to ensure that users can't delete a blob with attachments even if they don't have the foreign key constraint. See a related discussion in the Campfire: https://3.basecamp.com/3076981/buckets/24956/chats/12416418@1236718899 Note that, we should backport it to `5-2-stable` too. Related to #33405
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/oid/array.rb')
0 files changed, 0 insertions, 0 deletions