diff options
author | Vipul A M <vipulnsward@gmail.com> | 2013-05-17 09:04:44 +0530 |
---|---|---|
committer | Vipul A M <vipulnsward@gmail.com> | 2013-05-17 09:04:44 +0530 |
commit | 872e2a8184c3ba79d4fc5862bbfb09e12bb61ca1 (patch) | |
tree | cce9365a21d382b45317a88f456cc83fddbfb43b /activesupport | |
parent | 677b64fcd527529390e232ceedf8fa8bfac224e2 (diff) | |
download | rails-872e2a8184c3ba79d4fc5862bbfb09e12bb61ca1.tar.gz rails-872e2a8184c3ba79d4fc5862bbfb09e12bb61ca1.tar.bz2 rails-872e2a8184c3ba79d4fc5862bbfb09e12bb61ca1.zip |
"normalize_callback_params" doesn't require name param
Diffstat (limited to 'activesupport')
-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| |