-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
feature: generate resource from model attributes #1244
feature: generate resource from model attributes #1244
Conversation
Code Climate has analyzed commit 91cf1c5 and detected 4 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Codecov ReportBase: 94.29% // Head: 93.86% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1244 +/- ##
==========================================
- Coverage 94.29% 93.86% -0.43%
==========================================
Files 543 554 +11
Lines 10778 11361 +583
==========================================
+ Hits 10163 10664 +501
- Misses 615 697 +82
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
This PR has been marked as stale because there was no activity for the past 15 days. |
Can we add some tests to this too? They can be modeled after our current ones. |
Description
Fixes #182
Todo:
rails generate model
command and run the resource generator (see howfactory_bot
does it)Usage:
New model:
$ rails g model car make kms:integer
Will generate the normal scaffolding, the avo controller and will auto-fill the resource:
Extra option:
--without_resource
will not generate the avo controller + resource.$ rails g model car make kms:integer --without_resource
Existent model:
If we have this model post:
We can generate the avo resource by running:
$ rails g avo:resource post
Extra option:
--model_class
Lets say we want to generate an mini-post resource and this resource will have the post model as model_class, we can do it by running:
$ rails g avo:resource mini-post --model_class post
Checklist: