aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/callbacks.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-08 01:05:28 +0200
committerXavier Noria <fxn@hashref.com>2016-08-08 01:12:38 +0200
commita9dc45459abcd9437085f4dd0aa3c9d0e64e062f (patch)
treefe160bcd744ad3dffbe901a4b44df2c2343130de /activesupport/lib/active_support/callbacks.rb
parentb45c9ca9b6571108242c1dfc3d3e160f56baf025 (diff)
downloadrails-a9dc45459abcd9437085f4dd0aa3c9d0e64e062f.tar.gz
rails-a9dc45459abcd9437085f4dd0aa3c9d0e64e062f.tar.bz2
rails-a9dc45459abcd9437085f4dd0aa3c9d0e64e062f.zip
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.
Diffstat (limited to 'activesupport/lib/active_support/callbacks.rb')
-rw-r--r--activesupport/lib/active_support/callbacks.rb6
1 files changed, 3 insertions, 3 deletions
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 <tt>ArgumentError</tt> 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.