aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/scoping/default.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 /activerecord/lib/active_record/scoping/default.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 'activerecord/lib/active_record/scoping/default.rb')
-rw-r--r--activerecord/lib/active_record/scoping/default.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/scoping/default.rb b/activerecord/lib/active_record/scoping/default.rb
index 572a45aac9..7409706851 100644
--- a/activerecord/lib/active_record/scoping/default.rb
+++ b/activerecord/lib/active_record/scoping/default.rb
@@ -104,11 +104,11 @@ module ActiveRecord
def build_default_scope(base_rel = nil) # :nodoc:
return if abstract_class?
- if self.default_scope_override.nil?
+ if default_scope_override.nil?
self.default_scope_override = !Base.is_a?(method(:default_scope).owner)
end
- if self.default_scope_override
+ if default_scope_override
# The user has defined their own default scope method, so call that
evaluate_default_scope { default_scope }
elsif default_scopes.any?