From dd03f10d5258dab75da6b7ec493e6558b4ed2bac Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 14 May 2013 16:22:29 -0700 Subject: [PATCH] only dup the options once, the Callback object does not mutate them --- activesupport/lib/active_support/callbacks.rb | 4 ++-- 1 file 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 @@ def normalize_callback_params(name, filters, block) # :nodoc: 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 @@ def set_callback(name, *filter_list, &block) 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|