mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-30 06:31:16 +00:00
Revert "In specs, correctly disable referential integrity for postgres"
This reverts commit 1610e1448a.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user