Change root Chewy strategy to emit a warning instead of erroring out in production mode (#24327)
This commit is contained in:
		
							
								
								
									
										12
									
								
								lib/chewy/strategy/bypass_with_warning.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								lib/chewy/strategy/bypass_with_warning.rb
									
									
									
									
									
										Normal file
									
								
							| @@ -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 | ||||
		Reference in New Issue
	
	Block a user