Permalink
Browse files

"normalize_callback_params" doesn't require name param

  • Loading branch information...
1 parent 677b64f commit 872e2a8184c3ba79d4fc5862bbfb09e12bb61ca1 @vipulnsward vipulnsward committed May 17, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 activesupport/lib/active_support/callbacks.rb
@@ -537,7 +537,7 @@ def remove_duplicates(callback)
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 @@ def __update_callbacks(name) #:nodoc:
# * <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 @@ def set_callback(name, *filter_list, &block)
# 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|

0 comments on commit 872e2a8

Please sign in to comment.