Module: ActionArgs::ActiveSupport::CallbackParameterizer
- Included in:
- ActiveSupport::Callbacks::Callback
- Defined in:
- lib/action_args/callbacks.rb
Instance Method Summary collapse
-
#make_lambda(filter) ⇒ Object
Extending AS::Callbacks::Callback's
make_lambdanot just to call specified method but to call the method with method parameters taken fromparams.
Instance Method Details
#make_lambda(filter) ⇒ Object
Extending AS::Callbacks::Callback's make_lambda not just to call specified
method but to call the method with method parameters taken from params.
This would happen only when
- the filter was defined in Symbol form
- the target object is_a ActionController object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/action_args/callbacks.rb', line 11 def make_lambda(filter) if Symbol === filter lambda do |target, _, &blk| if ActionController::Base === target target.send_with_method_parameters_from_params filter, &blk else target.send filter, &blk end end else super end end |