From 0856f7c744e631b6efafbb14d01e60bbfaa593f5 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sat, 6 Apr 2019 12:00:17 +0900 Subject: There is no need to check `null_relation?` in `empty_scope?` `values[:extending]` includes `NullRelation` if `null_relation?`. --- activerecord/lib/active_record/relation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index c1cdad9c87..cd62b0b881 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -689,7 +689,7 @@ module ActiveRecord end def empty_scope? # :nodoc: - !null_relation? && @values == klass.unscoped.values + @values == klass.unscoped.values end def has_limit_or_offset? # :nodoc: -- cgit v1.2.3