From 4233937af73a98da549671f5632def0b3d70e6c2 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Thu, 10 Nov 2016 15:37:37 -0600 Subject: [PATCH] Wait for ActiveSupport to tell us when active_record is loaded This prevents overwriting the setting in Rails 5, as described in #129 --- lib/flipper-active_record.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/flipper-active_record.rb b/lib/flipper-active_record.rb index 49a71a755..1d95ec179 100644 --- a/lib/flipper-active_record.rb +++ b/lib/flipper-active_record.rb @@ -1 +1,3 @@ -require 'flipper/adapters/active_record' +ActiveSupport.on_load(:active_record) do + require 'flipper/adapters/active_record' +end