1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

fixing more variable names

This commit is contained in:
Aaron Patterson 2013-05-09 14:55:15 -07:00
parent 2b1d7ea335
commit 9b52026920

View file

@ -170,15 +170,15 @@ module ActiveSupport
# Wraps code with filter # Wraps code with filter
def apply(next_callback) def apply(next_callback)
conditions = conditions_lambdas user_conditions = conditions_lambdas
source = make_lambda @raw_filter user_callback = make_lambda @raw_filter
case @kind case @kind
when :before when :before
halted_lambda = eval "lambda { |result| #{chain.config[:terminator]} }" halted_lambda = eval "lambda { |result| #{chain.config[:terminator]} }"
lambda { |target, halted, value, &block| lambda { |target, halted, value, &block|
if !halted && conditions.all? { |c| c.call(target, value) } if !halted && user_conditions.all? { |c| c.call(target, value) }
result = source.call target, value result = user_callback.call target, value
halted = halted_lambda.call result halted = halted_lambda.call result
if halted if halted
target.send :halted_callback_hook, @raw_filter.inspect target.send :halted_callback_hook, @raw_filter.inspect
@ -190,25 +190,25 @@ module ActiveSupport
if chain.config[:skip_after_callbacks_if_terminated] if chain.config[:skip_after_callbacks_if_terminated]
lambda { |target, halted, value, &block| lambda { |target, halted, value, &block|
target, halted, value = next_callback.call target, halted, value, &block target, halted, value = next_callback.call target, halted, value, &block
if !halted && conditions.all? { |c| c.call(target, value) } if !halted && user_conditions.all? { |c| c.call(target, value) }
source.call target, value user_callback.call target, value
end end
[target, halted, value] [target, halted, value]
} }
else else
lambda { |target, halted, value, &block| lambda { |target, halted, value, &block|
target, halted, value = next_callback.call target, halted, value, &block target, halted, value = next_callback.call target, halted, value, &block
if conditions.all? { |c| c.call(target, value) } if user_conditions.all? { |c| c.call(target, value) }
source.call target, value user_callback.call target, value
end end
[target, halted, value] [target, halted, value]
} }
end end
when :around when :around
lambda { |target, halted, value, &block| lambda { |target, halted, value, &block|
if !halted && conditions.all? { |c| c.call(target, value) } if !halted && user_conditions.all? { |c| c.call(target, value) }
retval = nil retval = nil
source.call(target, value) { user_callback.call(target, value) {
retval = next_callback.call(target, halted, value, &block) retval = next_callback.call(target, halted, value, &block)
retval.last retval.last
} }