diff --git a/lib/jsonapi/active_relation_retrieval_v09.rb b/lib/jsonapi/active_relation_retrieval_v09.rb index 0ca023ea..2c526f0d 100644 --- a/lib/jsonapi/active_relation_retrieval_v09.rb +++ b/lib/jsonapi/active_relation_retrieval_v09.rb @@ -107,7 +107,12 @@ def find_fragments(filters, options = {}) filters: filters, sort_criteria: sort_criteria) - options[:_relation_helper_options] = { join_manager: join_manager, sort_fields: [] } + options[:_relation_helper_options] = { + context: context, + join_manager: join_manager, + sort_fields: [] + } + include_directives = options[:include_directives] records = records(options) @@ -116,7 +121,7 @@ def find_fragments(filters, options = {}) records = filter_records(records, filters, options) - records = sort_records(records, order_options, context) + records = sort_records(records, order_options, options) records = apply_pagination(records, options[:paginator], order_options)