Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow resource_name to be inherited #872

Merged
merged 3 commits into from
May 16, 2023

Conversation

stormsilver
Copy link
Contributor

@stormsilver stormsilver commented May 15, 2023

This is helpful if you have a very structured hierarchy of API controllers and would like to define the naming logic once in a base controller.

  • Allow resource_name to be a string, symbol, or proc
  • Search all the way up the controller hierarchy for a value
  • Continue searching even if a particular controller doesn't have a resource_description block

Edit: I had to set Rubocop's target Ruby version to 2.6 in order to get a bunch of offenses to go away. I'm not sure why that suddenly started happening (my PR from last week didn't have any issues).

This was causing the test commands not to show up on Github
* Allow resource_name to be a string, symbol, or proc
* Search all the way up the controller hierarchy for a value
* Continue searching even if a particular controller doesn't
  have a resource_description block

This is helpful if you have a very structured hierarchy of API
controllers and would like to define the naming logic once in
a base controller.
@PanosCodes
Copy link
Contributor

define the naming logic once in a base controller.

image

Copy link
Collaborator

@mathieujobin mathieujobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks all great!!! Thank you

@mathieujobin mathieujobin merged commit 9b2da98 into Apipie:master May 16, 2023
@stormsilver stormsilver deleted the recursive_parent branch May 16, 2023 11:06
stormsilver added a commit to rednovalabs/apipie-rails that referenced this pull request May 24, 2023
When using namespaced resources, climbing the controller hierarchy was broken in
really specific circumstances. Bug introduced in Apipie#872
stormsilver added a commit to rednovalabs/apipie-rails that referenced this pull request May 24, 2023
When using namespaced resources, climbing the controller hierarchy was broken in
really specific circumstances. Bug introduced in Apipie#872
stormsilver added a commit to rednovalabs/apipie-rails that referenced this pull request May 24, 2023
When using namespaced resources, climbing the controller hierarchy was broken in
really specific circumstances. Bug introduced in Apipie#872

(cherry picked from commit 3929761)
mathieujobin pushed a commit that referenced this pull request May 29, 2023
When using namespaced resources, climbing the controller hierarchy was broken in
really specific circumstances. Bug introduced in #872
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.

3 participants