aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/errors.rb
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-07-30 08:40:48 -0400
committerGeorge Claghorn <george@basecamp.com>2018-07-30 09:12:55 -0400
commit59c3ed1b3f90db197000e3867f255781a02412e7 (patch)
tree7df79eea4f986183f78468c818eac1cbb3c2d731 /activerecord/lib/active_record/errors.rb
parentcfee9feee423947cf9e6d2508a85507cca6f75f3 (diff)
downloadrails-59c3ed1b3f90db197000e3867f255781a02412e7.tar.gz
rails-59c3ed1b3f90db197000e3867f255781a02412e7.tar.bz2
rails-59c3ed1b3f90db197000e3867f255781a02412e7.zip
MySQL: Raise ActiveRecord::InvalidForeignKey for foreign-key constraint violations on delete
Diffstat (limited to 'activerecord/lib/active_record/errors.rb')
-rw-r--r--activerecord/lib/active_record/errors.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb
index c2a180c939..f61bc7b9e8 100644
--- a/activerecord/lib/active_record/errors.rb
+++ b/activerecord/lib/active_record/errors.rb
@@ -111,7 +111,8 @@ module ActiveRecord
class RecordNotUnique < WrappedDatabaseException
end
- # Raised when a record cannot be inserted or updated because it references a non-existent record.
+ # Raised when a record cannot be inserted or updated because it references a non-existent record,
+ # or when a record cannot be deleted because a parent record references it.
class InvalidForeignKey < WrappedDatabaseException
end