aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-08-17 00:07:35 -0300
committerGitHub <noreply@github.com>2016-08-17 00:07:35 -0300
commit0549f9debfe27b804d8b35a7c67e3bf015ae1b89 (patch)
tree19e9b4928a83dd786eb2696e490b955a3329f368 /activerecord
parent7eec1ba60483e22fb1dfd69f821cbb7a48ef6ff9 (diff)
parentab5070ede10c4ad9332f342232ab4d12db2bc5b0 (diff)
downloadrails-0549f9debfe27b804d8b35a7c67e3bf015ae1b89.tar.gz
rails-0549f9debfe27b804d8b35a7c67e3bf015ae1b89.tar.bz2
rails-0549f9debfe27b804d8b35a7c67e3bf015ae1b89.zip
Merge pull request #26037 from monmonmon/master
Check if the logger is not nil before using it
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/scoping/named.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/scoping/named.rb b/activerecord/lib/active_record/scoping/named.rb
index 46ee3540bd..094c0e9c6f 100644
--- a/activerecord/lib/active_record/scoping/named.rb
+++ b/activerecord/lib/active_record/scoping/named.rb
@@ -174,7 +174,7 @@ module ActiveRecord
protected
def valid_scope_name?(name)
- if respond_to?(name, true)
+ if respond_to?(name, true) && logger
logger.warn "Creating scope :#{name}. " \
"Overwriting existing method #{self.name}.#{name}."
end