diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-09-09 19:16:26 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-09-11 08:04:48 +0200 |
commit | 16868b53f9533ba48ca33bb694fade390f0ffe7e (patch) | |
tree | d25723db2b73ae81b4878f88c15ba27d519eff8d /activerecord/lib | |
parent | 1245a9e06c66e77813fda621e825afdeacf2cd49 (diff) | |
download | rails-16868b53f9533ba48ca33bb694fade390f0ffe7e.tar.gz rails-16868b53f9533ba48ca33bb694fade390f0ffe7e.tar.bz2 rails-16868b53f9533ba48ca33bb694fade390f0ffe7e.zip |
A `NullRelation` should represent nothing. Closes #15176.
[Matthew Draper & Yves Senn]
Closes #16860. (pull request to discuss the implementation)
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index e6a088d07e..bbddd28ccc 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -687,11 +687,11 @@ module ActiveRecord # end # def none - extending(NullRelation) + where("1=0").extending!(NullRelation) end def none! # :nodoc: - extending!(NullRelation) + where!("1=0").extending!(NullRelation) end # Sets readonly attributes for the returned relation. If value is |