Class: ActiveSupport::Callbacks::Filters::Before

Inherits:
Object
  • Object
show all
Defined in:
activesupport/lib/active_support/callbacks.rb

Class Method Summary collapse

Class Method Details

.build(callback_sequence, user_callback, user_conditions, chain_config, filter, name) ⇒ Object



164
165
166
167
168
169
170
171
172
# File 'activesupport/lib/active_support/callbacks.rb', line 164

def self.build(callback_sequence, user_callback, user_conditions, chain_config, filter, name)
  halted_lambda = chain_config[:terminator]

  if user_conditions.any?
    halting_and_conditional(callback_sequence, user_callback, user_conditions, halted_lambda, filter, name)
  else
    halting(callback_sequence, user_callback, halted_lambda, filter, name)
  end
end