From 1cfd6ffaf0ee44563e475d364c4d971c6cd2d0eb Mon Sep 17 00:00:00 2001 From: Jonathan Rochkind Date: Wed, 21 Aug 2019 16:20:24 -0400 Subject: [PATCH] ActiveRecord no longer has a "scoped" method Using the newer "none" method is a great way to do what the comment said was being done, return an AR Relation that's a null set. I'm not totally sure why this code is doing that or what's going on in the ActiveRecord::Wrapper class around 'sets' in general. I was unable to figure out how to make a test case that exersizes this code. Closes #49 --- lib/oai/provider/model/activerecord_wrapper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oai/provider/model/activerecord_wrapper.rb b/lib/oai/provider/model/activerecord_wrapper.rb index a975188..5859ed8 100755 --- a/lib/oai/provider/model/activerecord_wrapper.rb +++ b/lib/oai/provider/model/activerecord_wrapper.rb @@ -105,7 +105,7 @@ def find_scope(options) model.where(set: options[:set]) else # Default to empty set, as we've tried everything else - model.scoped(:limit => 0) + model.none end end