Skip to content

Commit 1cfd6ff

Browse files
committed
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
1 parent 5cf2baa commit 1cfd6ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/oai/provider/model/activerecord_wrapper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def find_scope(options)
105105
model.where(set: options[:set])
106106
else
107107
# Default to empty set, as we've tried everything else
108-
model.scoped(:limit => 0)
108+
model.none
109109
end
110110
end
111111

0 commit comments

Comments
 (0)