Skip to content
This repository
Browse code

"normalize_callback_params" doesn't require name param

  • Loading branch information...
commit 872e2a8184c3ba79d4fc5862bbfb09e12bb61ca1 1 parent 677b64f
Vipul A M authored May 17, 2013
6  activesupport/lib/active_support/callbacks.rb
@@ -537,7 +537,7 @@ def remove_duplicates(callback)
537 537
 
538 538
     module ClassMethods
539 539
 
540  
-      def normalize_callback_params(name, filters, block) # :nodoc:
  540
+      def normalize_callback_params(filters, block) # :nodoc:
541 541
         type = CALLBACK_FILTER_TYPES.include?(filters.first) ? filters.shift : :before
542 542
         options = filters.last.is_a?(Hash) ? filters.pop : {}
543 543
         filters.unshift(block) if block
@@ -589,7 +589,7 @@ def __update_callbacks(name) #:nodoc:
589 589
       # * <tt>:prepend</tt> - If +true+, the callback will be prepended to the
590 590
       #   existing chain rather than appended.
591 591
       def set_callback(name, *filter_list, &block)
592  
-        type, filters, options = normalize_callback_params(name, filter_list, block)
  592
+        type, filters, options = normalize_callback_params(filter_list, block)
593 593
         self_chain = get_callbacks name
594 594
         mapped = filters.map do |filter|
595 595
           Callback.build(self_chain, filter, type, options)
@@ -609,7 +609,7 @@ def set_callback(name, *filter_list, &block)
609 609
       #      skip_callback :validate, :before, :check_membership, if: -> { self.age > 18 }
610 610
       #   end
611 611
       def skip_callback(name, *filter_list, &block)
612  
-        type, filters, options = normalize_callback_params(name, filter_list, block)
  612
+        type, filters, options = normalize_callback_params(filter_list, block)
613 613
 
614 614
         __update_callbacks(name) do |target, chain|
615 615
           filters.each do |filter|

0 notes on commit 872e2a8

Please sign in to comment.
Something went wrong with that request. Please try again.