From 0c7c6286f653b947db8a2a17c11f0c213a8d23ea Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Wed, 11 Mar 2015 14:34:53 +0100 Subject: pg, `disable_referential_integrity` only catches AR errors. This change was prompted by 598b841. --- .../connection_adapters/postgresql/referential_integrity.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/connection_adapters') 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 -- cgit v1.2.3