aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-05-14 16:22:29 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-05-14 16:22:29 -0700
commitdd03f10d5258dab75da6b7ec493e6558b4ed2bac (patch)
treee0828213cb0c716f8ce320d50faa1af7aff035d1
parent132db318b324ab3829362d4aa29f1eef75ed1aea (diff)
downloadrails-dd03f10d5258dab75da6b7ec493e6558b4ed2bac.tar.gz
rails-dd03f10d5258dab75da6b7ec493e6558b4ed2bac.tar.bz2
rails-dd03f10d5258dab75da6b7ec493e6558b4ed2bac.zip
only dup the options once, the Callback object does not mutate them
-rw-r--r--activesupport/lib/active_support/callbacks.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index 1386c22f45..c4cfc11372 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -585,7 +585,7 @@ module ActiveSupport
type = CALLBACK_FILTER_TYPES.include?(filters.first) ? filters.shift : :before
options = filters.last.is_a?(Hash) ? filters.pop : {}
filters.unshift(block) if block
- [type, filters, options]
+ [type, filters, options.dup]
end
# This is used internally to append, prepend and skip callbacks to the
@@ -636,7 +636,7 @@ module ActiveSupport
type, filters, options = normalize_callback_params(name, filter_list, block)
self_chain = get_callbacks name
mapped = filters.map do |filter|
- Callback.build(self_chain, filter, type, options.dup)
+ Callback.build(self_chain, filter, type, options)
end
__update_callbacks(name) do |target, chain|