diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-05-19 12:18:12 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-05-19 12:18:12 -0700 |
commit | 534ef888992480b79e28bcaf6f2ae7e4b6129fa8 (patch) | |
tree | fe41ffd69944e60d19f81ae6be95703a85c235d1 /activesupport/lib/active_support | |
parent | d71b0935a956ebedea0bb975525fc0f5672e4088 (diff) | |
parent | 872e2a8184c3ba79d4fc5862bbfb09e12bb61ca1 (diff) | |
download | rails-534ef888992480b79e28bcaf6f2ae7e4b6129fa8.tar.gz rails-534ef888992480b79e28bcaf6f2ae7e4b6129fa8.tar.bz2 rails-534ef888992480b79e28bcaf6f2ae7e4b6129fa8.zip |
Merge pull request #10659 from vipulnsward/normalize_param2
"normalize_callback_params" doesn't require name param
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index bbfa74f98d..85b7669353 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -537,7 +537,7 @@ module ActiveSupport module ClassMethods - def normalize_callback_params(name, filters, block) # :nodoc: + def normalize_callback_params(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 @@ -589,7 +589,7 @@ module ActiveSupport # * <tt>:prepend</tt> - If +true+, the callback will be prepended to the # existing chain rather than appended. def set_callback(name, *filter_list, &block) - type, filters, options = normalize_callback_params(name, filter_list, block) + type, filters, options = normalize_callback_params(filter_list, block) self_chain = get_callbacks name mapped = filters.map do |filter| Callback.build(self_chain, filter, type, options) @@ -609,7 +609,7 @@ module ActiveSupport # skip_callback :validate, :before, :check_membership, if: -> { self.age > 18 } # end def skip_callback(name, *filter_list, &block) - type, filters, options = normalize_callback_params(name, filter_list, block) + type, filters, options = normalize_callback_params(filter_list, block) __update_callbacks(name) do |target, chain| filters.each do |filter| |