Skip to content

Commit

Permalink
Do not run callbacks on :bypass strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
sl4vr committed Dec 14, 2021
1 parent 54afc7b commit a77020e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/chewy/index/observe/active_record_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ module ActiveRecordMethods
extend ActiveSupport::Concern

def run_chewy_callbacks
return if Chewy.strategy.current.name == :bypass

chewy_callbacks.each { |callback| callback.call(self) }
end

def update_chewy_indices
return if Chewy.strategy.current.name == :bypass

Chewy.strategy.current.update_chewy_indices(self)
end

Expand Down

0 comments on commit a77020e

Please sign in to comment.