aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2016-10-21 08:17:21 -0700
committerGitHub <noreply@github.com>2016-10-21 08:17:21 -0700
commit0a3595f64d772e0b0babd4c50535e7299c754724 (patch)
treed1b17923e66c36975c90608465d322f10c6536a4
parenta08ef99d5f74301e027feb727c680b3a1fda44b2 (diff)
parent5f382d41c30b1e433d777a8daaedb247d7f2a57c (diff)
downloadrails-0a3595f64d772e0b0babd4c50535e7299c754724.tar.gz
rails-0a3595f64d772e0b0babd4c50535e7299c754724.tar.bz2
rails-0a3595f64d772e0b0babd4c50535e7299c754724.zip
Merge pull request #26854 from headius/explicit_order_callback_args
Explicitly unpack the expanded args to avoid execution order diff.
-rw-r--r--activesupport/lib/active_support/callbacks.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index 890b1cd73b..9b9c9cbbdd 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -410,8 +410,8 @@ module ActiveSupport
# values.
def make_lambda
lambda do |target, value, &block|
- c = expand(target, value, block)
- c.shift.send(*c, &c.shift)
+ target, block, method, *arguments = expand(target, value, block)
+ target.send(method, *arguments, &block)
end
end
@@ -419,8 +419,8 @@ module ActiveSupport
# values, but then return the boolean inverse of that result.
def inverted_lambda
lambda do |target, value, &block|
- c = expand(target, value, block)
- ! c.shift.send(*c, &c.shift)
+ target, block, method, *arguments = expand(target, value, block)
+ ! target.send(method, *arguments, &block)
end
end