Revert "In specs, correctly disable referential integrity for postgres"

This reverts commit 1610e1448a.
This commit is contained in:
Rohan Mitchell
2014-04-25 17:14:25 +10:00
parent 1610e1448a
commit ad6021a116
2 changed files with 0 additions and 24 deletions

View File

@@ -1,5 +1,3 @@
require 'open_food_network/foreign_keys_postgresql'
Openfoodnetwork::Application.configure do
# Settings specified here will take precedence over those in config/application.rb

View File

@@ -1,22 +0,0 @@
# http://kopongo.com/2008/7/25/postgres-ri_constrainttrigger-error
if Rails::VERSION::MAJOR < 4
# Fix fixtures with foreign keys, fixed in Rails 4
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
end