diff options
Diffstat (limited to 'activesupport/lib/active_support/callbacks.rb')
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index a450b0e6d4..a33cab0504 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -399,7 +399,7 @@ module ActiveSupport end else scopes = Array(chain_config[:scope]) - method_to_call = scopes.map{ |s| public_send(s) }.join("_") + method_to_call = scopes.map { |s| public_send(s) }.join("_") lambda { |target, _, &blk| filter.public_send method_to_call, target, &blk @@ -445,7 +445,7 @@ module ActiveSupport def around(&around) CallbackSequence.new do |arg| around.call(arg) { - self.call(arg) + call(arg) } end end @@ -624,7 +624,7 @@ module ActiveSupport # callback is skipped. # # class Writer < Person - # skip_callback :validate, :before, :check_membership, if: -> { self.age > 18 } + # skip_callback :validate, :before, :check_membership, if: -> { age > 18 } # end # # An <tt>ArgumentError</tt> will be raised if the callback has not @@ -635,7 +635,7 @@ module ActiveSupport __update_callbacks(name) do |target, chain| filters.each do |filter| - callback = chain.find {|c| c.matches?(type, filter) } + callback = chain.find { |c| c.matches?(type, filter) } if !callback && options[:raise] raise ArgumentError, "#{type.to_s.capitalize} #{name} callback #{filter.inspect} has not been defined" @@ -662,7 +662,7 @@ module ActiveSupport target.set_callbacks name, chain end - self.set_callbacks name, callbacks.dup.clear + set_callbacks(name, callbacks.dup.clear) end # Define sets of events in the object life cycle that support callbacks. |