aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authormonmon <shimon@skimatalk.com>2016-08-03 19:15:56 +0900
committermonmon <shimon@skimatalk.com>2016-08-03 19:15:56 +0900
commitab5070ede10c4ad9332f342232ab4d12db2bc5b0 (patch)
tree5a407471cf0ce97dd5a3c45dce7a555f6d63c7ad /activerecord/lib
parentba03e6adf30f24e60e5045808f1b56267d6e5d4d (diff)
downloadrails-ab5070ede10c4ad9332f342232ab4d12db2bc5b0.tar.gz
rails-ab5070ede10c4ad9332f342232ab4d12db2bc5b0.tar.bz2
rails-ab5070ede10c4ad9332f342232ab4d12db2bc5b0.zip
Check if the logger exists before trying to use it
Diffstat (limited to 'activerecord/lib')
-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 5395bd6076..e69c4ab657 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