From a9dc45459abcd9437085f4dd0aa3c9d0e64e062f Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Mon, 8 Aug 2016 01:05:28 +0200 Subject: code gardening: removes redundant selfs A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required. --- activesupport/lib/active_support/callbacks.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activesupport/lib/active_support/callbacks.rb') diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index a450b0e6d4..d6687ae937 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -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 ArgumentError will be raised if the callback has not @@ -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. -- cgit v1.2.3