From 825bae6593f8da09eb2fa5a1d23e639026b9a42e Mon Sep 17 00:00:00 2001 From: Jason Barnabe Date: Sat, 1 Feb 2020 16:02:47 -0600 Subject: [PATCH] Extend AR the proper way Per https://github.com/rails/rails/issues/23589#issuecomment-229247727 --- lib/wash_out.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/wash_out.rb b/lib/wash_out.rb index b6952c3a..75ce97cc 100644 --- a/lib/wash_out.rb +++ b/lib/wash_out.rb @@ -38,7 +38,9 @@ def wash_out(controller_name, options={}) end Mime::Type.register "application/soap+xml", :soap -ActiveRecord::Base.send :extend, WashOut::Model if defined?(ActiveRecord) +ActiveSupport.on_load(:active_record) do + extend WashOut::Model +end if defined?(ActiveRecord) ActionController::Renderers.add :soap do |what, options| _render_soap(what, options)