From 8438179d083d3daa2d1054d6fa4b4820c7bed8fe Mon Sep 17 00:00:00 2001 From: Stuart McHattie Date: Fri, 18 Oct 2024 15:00:33 +0100 Subject: [PATCH] Update devour rake task to only work on resources --- lib/tasks/devour.rake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/tasks/devour.rake b/lib/tasks/devour.rake index 56594d66b2..d76200af1a 100644 --- a/lib/tasks/devour.rake +++ b/lib/tasks/devour.rake @@ -6,11 +6,12 @@ namespace :devour do # We prettify our JSON to make it both easier to read and diff json_formatting = { indent: ' ', object_nl: "\n", space: ' ', array_nl: "\n" } - non_resource_symbols = %i[BaseResource Concerns SharedBehaviour Transfers] - base_resources = (Api::V2.constants - non_resource_symbols).map { |key| Api::V2.const_get(key) } - transfer_resources = Api::V2::Transfers.constants.map { |key| Api::V2::Transfers.const_get(key) } + resources = + (Api::V2.constants - %i[BaseResource]) + .map { |key| Api::V2.const_get(key) } + .select { |klass| klass < JSONAPI::Resource } config = - (base_resources + transfer_resources) + resources .sort_by { |resource| resource._type.to_s } .map do |resource| attributes = {}