-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 generating plugins for API applications #21003
Conversation
This way, running a generator inside the plugin's directory, files that are not relevant won't be generated (e.g. views or assets). This won't interfere with the application's generators configuration.
Allow generating plugins for API applications
Is the dummy app API only already? |
@rafaelfranca : Thanks for merging! I'm not sure to understand your question though ; the dummy app has been made API-only in robin850@ce32c9d. |
@robin850 👍, looks good from what I see. Will review properly next week. |
@spastorino it is already merged 😄 @robin850 I see, thank you for pointing. |
@rafaelfranca I know but a couple of more eyes taking a look at it wouldn't hurt :) |
@robin850 @rafaelfranca @spastorino I found a little issue related with this PR. Let's say you have a fresh only api application (created with Once you mount the engine and try the new routes in the host application, you get an The problem happens because AMS is not present when the resources are created in the engine, so serializers classes are not created (in fact, AMS does not seem to work in the context of an engine, adding this gem to the engine project is not enough). However, since AMS is added by default to a new rails api-only app, the exception will happen. Removing AMS from the host application solves the problem, but I'm concerned because this is not the default setup. This is probably material for a separate issue ticket, since I don't have a clear solution yet. |
Yeah, a separate issue would be better. |
Hello,
This pull requests adds a
--api
option in order to generate plugins that can be added inside API applications. It is split into several commits to ease the review process but once everything is fine, I can squash them.Cross-refs #19832 and the todo on Basecamp.
Have a nice day.