aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2015-03-11 14:34:53 +0100
committerYves Senn <yves.senn@gmail.com>2015-03-11 14:34:53 +0100
commit0c7c6286f653b947db8a2a17c11f0c213a8d23ea (patch)
tree3ff630928f57b8874dd5781b51c4282d7a795409 /activerecord/lib/active_record
parent598b841882cbfe1d88c55b9cc49a5a188735d0b1 (diff)
downloadrails-0c7c6286f653b947db8a2a17c11f0c213a8d23ea.tar.gz
rails-0c7c6286f653b947db8a2a17c11f0c213a8d23ea.tar.bz2
rails-0c7c6286f653b947db8a2a17c11f0c213a8d23ea.zip
pg, `disable_referential_integrity` only catches AR errors.
This change was prompted by 598b841.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/referential_integrity.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/referential_integrity.rb b/activerecord/lib/active_record/connection_adapters/postgresql/referential_integrity.rb
index 0ed8e72ea7..44a7338bf5 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/referential_integrity.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/referential_integrity.rb
@@ -14,7 +14,7 @@ module ActiveRecord
transaction(requires_new: true) do
execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} DISABLE TRIGGER ALL" }.join(";"))
end
- rescue => e
+ rescue ActiveRecord::ActiveRecordError => e
original_exception = e
end
@@ -37,7 +37,7 @@ Rails needs superuser privileges to disable referential integrity.
transaction(requires_new: true) do
execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} ENABLE TRIGGER ALL" }.join(";"))
end
- rescue
+ rescue ActiveRecord::ActiveRecordError
end
else
yield