Skip to content

Commit

Permalink
Merge pull request #26037 from monmonmon/master
Browse files Browse the repository at this point in the history
Check if the logger is not nil before using it
  • Loading branch information
rafaelfranca committed Aug 17, 2016
1 parent bec4686 commit e06a88c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/scoping/named.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def scope(name, body, &block)
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
Expand Down

0 comments on commit e06a88c

Please sign in to comment.