diff --git a/config/environments/test.rb b/config/environments/test.rb index 5848cbc22e..e1291ab4b4 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -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 diff --git a/lib/open_food_network/foreign_keys_postgresql.rb b/lib/open_food_network/foreign_keys_postgresql.rb deleted file mode 100644 index 4a4d06fd3d..0000000000 --- a/lib/open_food_network/foreign_keys_postgresql.rb +++ /dev/null @@ -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