def run_targeted_callbacks(place, kind)
      name = "_run__#{place}__#{kind}__callbacks"
      unless respond_to?(name)
        chain = ActiveSupport::Callbacks::CallbackChain.new(name, {})
        send("_#{kind}_callbacks").each do |callback|
          chain.append(callback) if callback.kind == place
        end
        self.class.send :define_method, name do
          env = ActiveSupport::Callbacks::Filters::Environment.new(self, false, nil)
          sequence = chain.compile
          sequence.invoke_before(env)
          env.value = !env.halted
          sequence.invoke_after(env)
          env.value
        end
        self.class.send :protected, name
      end
      send(name)
    end
def run_targeted_callbacks(place, kind)
      name = "_run__#{place}__#{kind}__callbacks"
      unless respond_to?(name)
        chain = ActiveSupport::Callbacks::CallbackChain.new(name, {})
        send("_#{kind}_callbacks").each do |callback|
          chain.append(callback) if callback.kind == place
        end
        self.class.send :define_method, name do
          env = ActiveSupport::Callbacks::Filters::Environment.new(self, false, nil)
          sequence = chain.compile
          sequence.invoke_before(env)
          env.value = !env.halted
          sequence.invoke_after(env)
          env.value
        end
        self.class.send :protected, name
      end
      send(name)
    end
Run only the callbacks for the target location (before, after, around)
 and kind (save, update, create).

 @example Run the targeted callbacks.
   model.run_targeted_callbacks(:before, :save)

 @param [ Symbol ] place The time to run, :before, :after, :around.
 @param [ Symbol ] kind The type of callback, :save, :create, :update.

 @return [ Object ] The result of the chain execution.

 @since 3.0.0