method

halting

Importance_0
v7.1.3.2 - Show latest stable - 0 notes - Class: Before
halting(callback_sequence, user_callback, halted_lambda, filter, name) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/callbacks.rb, line 195
          def self.halting(callback_sequence, user_callback, halted_lambda, filter, name)
            callback_sequence.before do |env|
              target = env.target
              value  = env.value
              halted = env.halted

              unless halted
                result_lambda = -> { user_callback.call target, value }
                env.halted = halted_lambda.call(target, result_lambda)
                if env.halted
                  target.send :halted_callback_hook, filter, name
                end
              end

              env
            end
          end
Register or log in to add new notes.