-
Notifications
You must be signed in to change notification settings - Fork 78
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
Can use namespaced model #132
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
like target = Namespace::Model scope api/v1/models/model_id/notifications
Hi @Eth3rnit3 Great! Thank you for your contribution, but can I ask one more thing?
Thank you! |
Hello @simukappu I have just updated the setup section of the documentation by giving an example of integration with a submodule model. Have a nice day |
Cool. Thank you! |
simukappu
force-pushed
the
development
branch
3 times, most recently
from
March 15, 2020 15:25
713969b
to
ccd84f7
Compare
simukappu
pushed a commit
that referenced
this pull request
Aug 3, 2020
* Enable to use namespaced target in other scope like target = Namespace::Model scope api/v1/models/model_id/notifications * Fix after create error of subscription controller * Update documentation about namespaced target model
simukappu
pushed a commit
that referenced
this pull request
Aug 10, 2020
* Enable to use namespaced target in other scope like target = Namespace::Model scope api/v1/models/model_id/notifications * Fix after create error of subscription controller * Update documentation about namespaced target model
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I will create this pull-request if it can make the gem evolve a bit.
Namespaced models
I encountered a problem when I wanted to use a target model under module. example
Entity::House
and this model must have a route in this format /api/v1/houses I know it's a bit peculiar but the only way I found to do it was to define my routes in the following wayNested patterns are problematic in
set_target
methods because the'/'
preventstarget_type.to_s.to_resource_name
from working properly.That's why I added a regex that keeps only what comes after the last `'/'' symbol in each transformation.
thus
After create subscription
After creating a new subscription through the api, I receive this error
The subscription is well created, I can find it afterwards and update it without any problem, it's only the render of the create method that poses a problem.
Fix with development...Eth3rnit3:master#diff-537d9b369239b60813ca53c7855b1593R47
Minimal change
While browsing this file I realized that 2 methods were doing the same thing except that one was converting the result to a symbol, I just made the first one call the second one.
development...Eth3rnit3:master#diff-9797a15e0073d37a0b5bfa1df2b2f692R485