feat: allow serialize callback in hasOne and hasMany
Proposed changes
This will add the serialize feature of column in the hasOne decorator
Types of changes
What types of changes does your code introduce?
Put an x in the boxes that apply
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
- [x] I have read the CONTRIBUTING doc
- [x] Lint and unit tests pass locally with my changes
- [x] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have added necessary documentation (if appropriate)
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...
@thetutlage I'm mentoring Sébastien on this (the idea is to add support for serialize callback in @hasOne).
@targos Can we have it for the relationships?
@thetutlage Do you mean for the other relationships too?
Yup
Let's start with one, and try to replicate to the others after :)
Let's start with one, and try to replicate to the others after :)
I think we will have to release all of them together, so that all relationships have similar and consistent API.
But yes, in the PR, we can do it one at a time
I know the PR is in draft mode. So feel free to ignore this comment.
I see there is only one test committed to the source code. Is it that you are going to implement the serialize method afterwards?
I know the PR is in draft mode. So feel free to ignore this comment.
I see there is only one test committed to the source code. Is it that you are going to implement the serialize method afterwards?
i wanted to create the PR first to allow me to test before creating my PR i can close this Pr and re-open it after if wanted ?
@Sebastien-Ahkrin
No worries. You can also use this PR to add the actual implementation. I asked to make sure that my understanding is correct :)
@thetutlage i have a little question so about how to run the test cases in my computer ....
After running, the npm run test script, i have this error message:

Do i have to do something ? i really wanted to run my test in my computer :/
I think for the serialization change, you can skip docker altogether and run tests using sqlite only.
So, please run npm run test:sqlite to run tests
@thetutlage We made an initial implementation on @hasOne? We would like to have you feedback on it before doing the change to the other kinds of relations.
@thetutlage does it LGTY now?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@thetutlage We still hope that you can review/merge this one day.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.