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

Add assosiations type to model generator #101

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

stuk88
Copy link

@stuk88 stuk88 commented Dec 6, 2024

Until now it was sails generate model Cart user:string And no way to pass assosiations.
Now you can put the assosiated object in array brackets and it generates model with assosiations.
New way:
sails generate model Cart user:[User]
and it will generate

user: {
model: 'user'
}

sails generate model Cart users:[User]
and it will generate

user: {
collection: 'user'
}

add support for collection attribute (Assosiations)
Update attribute.template on generate model
@stuk88
Copy link
Author

stuk88 commented Dec 6, 2024

dont know about the whitespace... need to test.

add support for single model assosiation
@stuk88
Copy link
Author

stuk88 commented Dec 6, 2024

Added support for one to one and many to many assosiation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant