lib/jsonapi/resource.rb
# Override this method if you have more complex requirements than this basic find method provides
Override this method if you have more complex requirements than this basic find method provides
Override this method if you have more complex requirements than this basic find method provides
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 = []
        records.each do |model|
          resources.push self.resource_for_model(model).new(model, context)
        end
        resources
      end
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 = [ ] records . each do | model | resources . push self . resource_for_model ( model ) . new ( model , context ) end resources end
Override this method if you have more complex requirements than this basic find method provides
Override this method if you have more complex requirements than this basic find method provides
filters
<not_specific>
options
<not_specific>