Class: ActiveSupport::Callbacks::Filters::After

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) ⇒ Object



212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'activesupport/lib/active_support/callbacks.rb', line 212

def self.build(callback_sequence, user_callback, user_conditions, chain_config)
  if chain_config[:skip_after_callbacks_if_terminated]
    if user_conditions.any?
      halting_and_conditional(callback_sequence, user_callback, user_conditions)
    else
      halting(callback_sequence, user_callback)
    end
  else
    if user_conditions.any?
      conditional callback_sequence, user_callback, user_conditions
    else
      simple callback_sequence, user_callback
    end
  end
end