From d92166cb26efa2f0bd8e2adad1b8024beefbfd81 Mon Sep 17 00:00:00 2001 From: Norman Clarke Date: Wed, 18 Apr 2012 14:44:32 -0300 Subject: Check for nil logger --- activerecord/lib/active_record/scoping/named.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/scoping/named.rb b/activerecord/lib/active_record/scoping/named.rb index 0edc3f1dcc..9c50baa647 100644 --- a/activerecord/lib/active_record/scoping/named.rb +++ b/activerecord/lib/active_record/scoping/named.rb @@ -191,7 +191,7 @@ module ActiveRecord protected def valid_scope_name?(name) - if respond_to?(name, true) + if logger && respond_to?(name, true) logger.warn "Creating scope :#{name}. " \ "Overwriting existing method #{self.name}.#{name}." end -- cgit v1.2.3