diff options
author | monmon <shimon@skimatalk.com> | 2016-08-03 19:15:56 +0900 |
---|---|---|
committer | monmon <shimon@skimatalk.com> | 2016-08-03 19:15:56 +0900 |
commit | ab5070ede10c4ad9332f342232ab4d12db2bc5b0 (patch) | |
tree | 5a407471cf0ce97dd5a3c45dce7a555f6d63c7ad | |
parent | ba03e6adf30f24e60e5045808f1b56267d6e5d4d (diff) | |
download | rails-ab5070ede10c4ad9332f342232ab4d12db2bc5b0.tar.gz rails-ab5070ede10c4ad9332f342232ab4d12db2bc5b0.tar.bz2 rails-ab5070ede10c4ad9332f342232ab4d12db2bc5b0.zip |
Check if the logger exists before trying to use it
-rw-r--r-- | activerecord/lib/active_record/scoping/named.rb | 2 |
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 |