Method: JSONAPI::Resource.find

Defined in:
lib/jsonapi/resource.rb

.find(filters, options = {}) ⇒ Object

Override this method if you have more complex requirements than this basic find method provides



731
732
733
734
735
736
737
738
739
740
741
742
743
# File 'lib/jsonapi/resource.rb', line 731

def find(filters, options = {})
  context = options[:context]

  records = filter_records(filters, options)

  sort_criteria = options.fetch(:sort_criteria) { [] }
  order_options = construct_order_options(sort_criteria)
  records = sort_records(records, order_options, context)

  records = apply_pagination(records, options[:paginator], order_options)

  resources_for(records, context)
end