diff options
author | Henare Degan <henare.degan@gmail.com> | 2013-03-03 15:01:51 +1100 |
---|---|---|
committer | Henare Degan <henare.degan@gmail.com> | 2013-03-03 15:01:51 +1100 |
commit | b5c51ce57dbabf7638f354c91f75ea52d75d2347 (patch) | |
tree | bfcb1d599b5ff58d339f211e4a0f10f41659a5e6 | |
parent | cbdff06aa95a7987b54c712dc6729e138f608eca (diff) |
See how we go not disabling this now
-rw-r--r-- | config/environments/test.rb | 2 | ||||
-rw-r--r-- | lib/patches/fixtures_constraint_disabling.rb | 21 |
2 files changed, 0 insertions, 23 deletions
diff --git a/config/environments/test.rb b/config/environments/test.rb index c569af8cd..df39e8873 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,8 +1,6 @@ Alaveteli::Application.configure do # Settings specified here will take precedence over those in config/environment.rb - require 'patches/fixtures_constraint_disabling' - # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped 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 - |