From 719c45b408d850d370bf58152efe6caeccac0804 Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Wed, 24 Jan 2018 16:28:20 +0100 Subject: [PATCH] Apply Rails 4 patch at boot time not only specs This makes this patch available also for things like database-related rake tasks. It moves the patch to an initializer. --- .../active_record_postgresql_referential_integrity_patch.rb | 1 - spec/spec_helper.rb | 3 --- 2 files changed, 4 deletions(-) rename {spec/support => config/initializers}/active_record_postgresql_referential_integrity_patch.rb (99%) diff --git a/spec/support/active_record_postgresql_referential_integrity_patch.rb b/config/initializers/active_record_postgresql_referential_integrity_patch.rb similarity index 99% rename from spec/support/active_record_postgresql_referential_integrity_patch.rb rename to config/initializers/active_record_postgresql_referential_integrity_patch.rb index ae508d653d..1bb73c4664 100644 --- a/spec/support/active_record_postgresql_referential_integrity_patch.rb +++ b/config/initializers/active_record_postgresql_referential_integrity_patch.rb @@ -6,7 +6,6 @@ # See: # - https://github.com/matthuhiggins/foreigner/issues/61 # - https://github.com/garysweaver/rails/commit/9bb27f7ffe3eb732df737e477cd8fc25e007f77b - if Rails::VERSION::MAJOR < 4 class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter def disable_referential_integrity #:nodoc: diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 806ed37f9b..0679613855 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -48,9 +48,6 @@ Capybara.default_max_wait_time = 30 require "paperclip/matchers" -#Fix fixtures with foreign keys, fixed in Rails4 -require_relative "support/active_record_postgresql_referential_integrity_patch" - # Override setting in Spree engine: Spree::Core::MailSettings ActionMailer::Base.default_url_options[:host] = 'test.host'