-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add Jennifer Recipe #20
Conversation
@faustinoaq after merging master into this branch it is impossible to find what are the original changes. Would you mind if I reset last merge commit and do rebase instead of merge (maybe I will have to squash commits)? The opposite solution is to create separate PR with my original changes and add changes what are done here. What do you think? |
@imdrasil Edit: Fixed!!! 🎉 |
@imdrasil Edit: Fixed!!! 🎉 |
@imdrasil I just fixed merge issues, All Jennifer code has been synced with master successfully ✨ 🎉 |
@@ -0,0 +1,32 @@ | |||
{% assign id_field_type = "Primary32" -%} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ATM Jennifer by default use Int32 field database type for a primary key.
{%- for field in fields -%} | ||
{%- if field.name != "id" -%} | ||
{%- if field.type == "reference" %} | ||
{{ field.name }}_id: { type: Int32? }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with foreign keys ^^^
end | ||
|
||
def {{ name }}_params | ||
{{ class_name }}.build_params( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I need some advice: Jennifer has own built-in validation + she can't use Hash(String, String)
as an argument for building objects. Should I use arguments validation anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation in the controller is validation of the incoming parameters before it hits the ORM layer so I think you would leave that method as it is.
Hi @imdrasil Thank you for your latest commits, very appreciated! 👍 Just a comment: The Current specs are failing because formatting issues on generated code:
^^ These don't include |
3c76d40
to
40ea5f4
Compare
40ea5f4
to
e2b0c89
Compare
Ping! @imdrasil @damianham |
Hi. I had some stuff to do. Will return to this from Sunday. |
@imdrasil awesome I saw the new version of Jennifer and it would be great to have this recipe available for the next release |
aa4c432
to
915acdf
Compare
7700faa
to
24b225f
Compare
24b225f
to
33b02f9
Compare
@@ -7,8 +7,7 @@ logging: | |||
filter: | |||
- password | |||
- confirm_password | |||
skip: | |||
- | |||
skip: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
such kind of change is made because the previous case created [nil]
array.
@faustinoaq , @eliasjpr please take a look at my changes when have some free time |
This is awesome @imdrasil. Can you add a readme to the recipe on how to setup. I think it will come in handy. |
@faustinoaq please take a look at the changes when have some free time |
@imdrasil Yeah, sorry for late reply, I'm organizing a lot of things first. I'll check this, Don't worry 😉 |
Hi @imdrasil @damianham
This PR tries to add a Jennifer Recipe to replace amberframework/amber#766
This will be easier to maintain, contribute, test and deploy because amber templates a becoming too complex, so recipes to rescue!!! 😉
This is an initial implementation, so, there are some issues to fix:
amber new
doesn't allow other models, just granite and crecto, see: Parsing Error: The -m option must be one of granite, crecto. amber#827Roadmap
jennifer_spec.cr
and auto-deploy support using Travissam.cr
file