Skip to content
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

feat: allow serialize callback in hasOne and hasMany #875

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

Sebastien-Ahkrin
Copy link

@Sebastien-Ahkrin Sebastien-Ahkrin commented Aug 30, 2022

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)
  • 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.

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes
  • 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...

@Sebastien-Ahkrin Sebastien-Ahkrin marked this pull request as draft August 30, 2022 09:11
@targos
Copy link
Member

targos commented Aug 30, 2022

@thetutlage I'm mentoring Sébastien on this (the idea is to add support for serialize callback in @hasOne).

@thetutlage
Copy link
Member

@targos Can we have it for the relationships?

@targos
Copy link
Member

targos commented Aug 30, 2022

@thetutlage Do you mean for the other relationships too?

@thetutlage
Copy link
Member

Yup

@targos
Copy link
Member

targos commented Aug 30, 2022

Let's start with one, and try to replicate to the others after :)

@thetutlage
Copy link
Member

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

@thetutlage
Copy link
Member

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?

@Sebastien-Ahkrin
Copy link
Author

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 ?

@thetutlage
Copy link
Member

@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 :)

@Sebastien-Ahkrin
Copy link
Author

Sebastien-Ahkrin commented Sep 2, 2022

@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:

Capture d’écran 2022-09-02 à 12 01 16

Do i have to do something ? i really wanted to run my test in my computer :/

@thetutlage
Copy link
Member

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

@Sebastien-Ahkrin Sebastien-Ahkrin marked this pull request as ready for review September 6, 2022 10:15
@targos
Copy link
Member

targos commented Sep 6, 2022

@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.

src/Orm/BaseModel/index.ts Show resolved Hide resolved
adonis-typings/relations.ts Outdated Show resolved Hide resolved
adonis-typings/relations.ts Outdated Show resolved Hide resolved
adonis-typings/relations.ts Outdated Show resolved Hide resolved
src/Orm/BaseModel/index.ts Outdated Show resolved Hide resolved
@Sebastien-Ahkrin Sebastien-Ahkrin marked this pull request as draft September 21, 2022 14:34
@Sebastien-Ahkrin Sebastien-Ahkrin marked this pull request as ready for review October 10, 2022 09:27
@targos
Copy link
Member

targos commented Nov 7, 2022

@thetutlage does it LGTY now?

@targos targos changed the title test: add test on serialize on a User Model feat: allow serialize callback in hasOne and hasMany Nov 7, 2022
@targos targos requested review from thetutlage and removed request for thetutlage November 16, 2022 10:19
@stale
Copy link

stale bot commented Jan 16, 2023

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.

@stale stale bot added the Status: Abandoned Dropped and not into consideration label Jan 16, 2023
@targos targos added Status: Review Needed Review from the core team is required before moving forward and removed Status: Abandoned Dropped and not into consideration labels Jan 16, 2023
@stale
Copy link

stale bot commented Mar 18, 2023

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.

@stale stale bot added the Status: Abandoned Dropped and not into consideration label Mar 18, 2023
@targos targos removed the Status: Abandoned Dropped and not into consideration label Mar 18, 2023
@stale
Copy link

stale bot commented May 18, 2023

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.

@stale stale bot added the Status: Abandoned Dropped and not into consideration label May 18, 2023
@targos targos removed the Status: Abandoned Dropped and not into consideration label May 19, 2023
@targos
Copy link
Member

targos commented May 19, 2023

@thetutlage We still hope that you can review/merge this one day.

@stale
Copy link

stale bot commented Aug 10, 2023

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.

@stale stale bot added the Status: Abandoned Dropped and not into consideration label Aug 10, 2023
@targos targos removed the Status: Abandoned Dropped and not into consideration label Aug 10, 2023
@stale
Copy link

stale bot commented Oct 15, 2023

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.

@stale stale bot added the Status: Abandoned Dropped and not into consideration label Oct 15, 2023
@targos targos removed the Status: Abandoned Dropped and not into consideration label Oct 17, 2023
Copy link

stale bot commented Mar 17, 2024

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.

@stale stale bot added the Status: Abandoned Dropped and not into consideration label Mar 17, 2024
@targos targos removed the Status: Abandoned Dropped and not into consideration label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed Review from the core team is required before moving forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants