From 5c499f54e3ecc2fab6de2ff76441a11ddf3c503d Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 3 Apr 2023 15:05:39 +0200 Subject: Change root Chewy strategy to emit a warning instead of erroring out in production mode (#24327) --- lib/chewy/strategy/bypass_with_warning.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/chewy/strategy/bypass_with_warning.rb (limited to 'lib') diff --git a/lib/chewy/strategy/bypass_with_warning.rb b/lib/chewy/strategy/bypass_with_warning.rb new file mode 100644 index 000000000..eb6fbaab1 --- /dev/null +++ b/lib/chewy/strategy/bypass_with_warning.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Chewy + class Strategy + class BypassWithWarning < Base + def update(...) + Rails.logger.warn 'Chewy update without a root strategy' unless @warning_issued + @warning_issued = true + end + end + end +end -- cgit