module Mongoid::Criteria::Scrollable::Fields

Shared by *::Scrollable modules

Private Instance Methods

different_sort_fields?(cursor, criteria_cursor_options) click to toggle source
# File lib/mongoid/criteria/scrollable/fields.rb, line 13
def different_sort_fields?(cursor, criteria_cursor_options)
  criteria_cursor_options[:field_type] = criteria_cursor_options[:field_type].to_s
  criteria_cursor_options[:field_name] = criteria_cursor_options[:field_name].to_s
  criteria_cursor_options != cursor.sort_options
end
raise_mismatched_sort_fields_error!(cursor, criteria_cursor_options) click to toggle source
# File lib/mongoid/criteria/scrollable/fields.rb, line 8
def raise_mismatched_sort_fields_error!(cursor, criteria_cursor_options)
  diff = cursor.sort_options.reject { |k, v| criteria_cursor_options[k] == v }
  raise Mongoid::Scroll::Errors::MismatchedSortFieldsError.new(diff: diff)
end