Skip to content

Commit

Permalink
Update devour rake task to only work on resources
Browse files Browse the repository at this point in the history
  • Loading branch information
sdjmchattie committed Oct 18, 2024
1 parent e78b99f commit 8438179
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/tasks/devour.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Check warning on line 12 in lib/tasks/devour.rake

View check run for this annotation

Codecov / codecov/patch

lib/tasks/devour.rake#L10-L12

Added lines #L10 - L12 were not covered by tests
config =
(base_resources + transfer_resources)
resources

Check warning on line 14 in lib/tasks/devour.rake

View check run for this annotation

Codecov / codecov/patch

lib/tasks/devour.rake#L14

Added line #L14 was not covered by tests
.sort_by { |resource| resource._type.to_s }
.map do |resource|
attributes = {}
Expand Down

0 comments on commit 8438179

Please sign in to comment.