lib/mongoid/criterion/scrollable.rb in mongoid-scroll-0.3.4 vs lib/mongoid/criterion/scrollable.rb in mongoid-scroll-0.3.5

- old
+ new

@@ -3,10 +3,10 @@ module Scrollable def scroll(cursor = nil, &_block) criteria = self # we don't support scrolling over a criteria with multiple fields if criteria.options[:sort] && criteria.options[:sort].keys.size != 1 - fail Mongoid::Scroll::Errors::MultipleSortFieldsError.new(sort: criteria.options[:sort]) + raise Mongoid::Scroll::Errors::MultipleSortFieldsError.new(sort: criteria.options[:sort]) elsif !criteria.options.key?(:sort) || criteria.options[:sort].empty? # introduce a default sort order if there's none criteria = criteria.asc(:_id) end # scroll field and direction