Skip to content

Add related scope to related routes, similar to relationships routes#1252

Merged
lgebhardt merged 1 commit intoJSONAPI-Resources:release-0-9from
reidab:related-route-scope
May 29, 2019
Merged

Add related scope to related routes, similar to relationships routes#1252
lgebhardt merged 1 commit intoJSONAPI-Resources:release-0-9from
reidab:related-route-scope

Conversation

@reidab
Copy link
Copy Markdown
Contributor

@reidab reidab commented May 20, 2019

This addresses #1251 by adding a related scope prefix to related resource routes, similar to the relationships prefix for relationship routes.

Fixes #1251

All Submissions:

  • I've checked to ensure there aren't other open Pull Requests for the same update/change.
  • I've submitted a ticket for my issue if one did not already exist.
  • My submission passes all tests. (Please run the full test suite locally to cut down on noise from travis failures.)
  • I've used Github auto-closing keywords in the commit message or the description.
  • I've added/updated tests for this change.

Bug fixes and Changes to Core Features:

  • I've included an explanation of what the changes do and why I'd like you to include them.
  • I've provided test(s) that fails without the change.

Test Plan:

Ensure that list_items_path generates the path to the ListItemResource index, instead of failing to generate the incorrect related resource path.

Reviewer Checklist:

  • Maintains compliance with JSON:API
  • Adequate test coverage exists to prevent regressions

This dodges an issue where the related route names might conflict with
index routes (e.g. a List that `has_many :items, class_name: 'ListItem'`
would have previously used `list_items` for the related resources and
conflict with the `list_items` index route for the ListItem class`)
@lgebhardt lgebhardt merged commit 5063b8c into JSONAPI-Resources:release-0-9 May 29, 2019
@lgebhardt
Copy link
Copy Markdown
Contributor

@reidab Thanks for finding and fixing this issue.

@lgebhardt lgebhardt mentioned this pull request May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants