From b5c51ce57dbabf7638f354c91f75ea52d75d2347 Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Sun, 3 Mar 2013 15:01:51 +1100 Subject: See how we go not disabling this now --- lib/patches/fixtures_constraint_disabling.rb | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 lib/patches/fixtures_constraint_disabling.rb (limited to 'lib/patches/fixtures_constraint_disabling.rb') diff --git a/lib/patches/fixtures_constraint_disabling.rb b/lib/patches/fixtures_constraint_disabling.rb deleted file mode 100644 index 7d97e81f7..000000000 --- a/lib/patches/fixtures_constraint_disabling.rb +++ /dev/null @@ -1,21 +0,0 @@ -# An alternative way of disabling foreign keys in fixture loading in Postgres and -# does not require superuser permissions -# http://kopongo.com/2008/7/25/postgres-ri_constrainttrigger-error -require 'active_record/connection_adapters/postgresql_adapter' -module ActiveRecord - module ConnectionAdapters - class PostgreSQLAdapter < AbstractAdapter - def disable_referential_integrity(&block) - transaction { - begin - execute "SET CONSTRAINTS ALL DEFERRED" - yield - ensure - execute "SET CONSTRAINTS ALL IMMEDIATE" - end - } - end - end - end -end - -- cgit v1.2.3