From 0c1cfa1fdfcb6eb4edfbd30dee8f8f790ffa68e5 Mon Sep 17 00:00:00 2001 From: Erik Regla Date: Thu, 5 Jul 2018 12:43:17 -0400 Subject: [PATCH 1/2] feature(formatter): Adds support for in options passed through jsonapi_render --- lib/jsonapi/utils/response/formatters.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/jsonapi/utils/response/formatters.rb b/lib/jsonapi/utils/response/formatters.rb index c46641c..878f70e 100644 --- a/lib/jsonapi/utils/response/formatters.rb +++ b/lib/jsonapi/utils/response/formatters.rb @@ -186,6 +186,8 @@ def turn_into_resource(record, options) # @api private def result_options(records, options) {}.tap do |data| + data[:meta] = options.fetch(:meta, {}) + if JSONAPI.configuration.default_paginator != :none && JSONAPI.configuration.top_level_links_include_pagination data[:pagination_params] = pagination_params(records, options) From 343112e2e89388ff9b6009d622515686f0fbed2e Mon Sep 17 00:00:00 2001 From: Erik Regla Date: Thu, 5 Jul 2018 12:44:28 -0400 Subject: [PATCH 2/2] fix(formatters.rb): indentation --- lib/jsonapi/utils/response/formatters.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jsonapi/utils/response/formatters.rb b/lib/jsonapi/utils/response/formatters.rb index 878f70e..961e9fa 100644 --- a/lib/jsonapi/utils/response/formatters.rb +++ b/lib/jsonapi/utils/response/formatters.rb @@ -186,7 +186,7 @@ def turn_into_resource(record, options) # @api private def result_options(records, options) {}.tap do |data| - data[:meta] = options.fetch(:meta, {}) + data[:meta] = options.fetch(:meta, {}) if JSONAPI.configuration.default_paginator != :none && JSONAPI.configuration.top_level_links_include_pagination