From 993c7c1e7bf29f78df5cc990030eef94557d8846 Mon Sep 17 00:00:00 2001 From: Stefan Wienert Date: Fri, 27 Sep 2024 18:00:50 +0200 Subject: [PATCH] Fix: Wrap Rails integrations into AS::Callback (#327) --- lib/datagrid.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/datagrid.rb b/lib/datagrid.rb index 57cff67..da8579c 100644 --- a/lib/datagrid.rb +++ b/lib/datagrid.rb @@ -14,10 +14,14 @@ module Datagrid autoload :Configuration autoload :Helper - ActionView::Base.send(:include, Datagrid::Helper) + ::ActiveSupport.on_load(:action_view) do + ActionView::Base.send(:include, Datagrid::Helper) + end autoload :FormBuilder - ActionView::Helpers::FormBuilder.send(:include, Datagrid::FormBuilder) + ::ActiveSupport.on_load(:action_view) do + ActionView::Helpers::FormBuilder.send(:include, Datagrid::FormBuilder) + end autoload :Renderer