From c099574a6a6903d6f3b00a5a9396913e9efb7156 Mon Sep 17 00:00:00 2001 From: upinetree Date: Fri, 7 Oct 2016 08:45:55 +0900 Subject: [PATCH] Support ActiveRecord config loading Use AS.on_load to avoid setting AR consts before config loaded. It fixes `belongs_to_required _by_default` config behaviour disscussed in https://github.com/rails/rails/issues/23589 --- lib/seed-fu.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/seed-fu.rb b/lib/seed-fu.rb index 4748559..933c0f4 100644 --- a/lib/seed-fu.rb +++ b/lib/seed-fu.rb @@ -31,6 +31,6 @@ def self.seed(fixture_paths = SeedFu.fixture_paths, filter = nil) end # @public -class ActiveRecord::Base +ActiveSupport.on_load(:active_record) do extend SeedFu::ActiveRecordExtension end