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

is it possible to make updates with fixtures? #19

Closed
nextor2k opened this issue Oct 30, 2014 · 5 comments
Closed

is it possible to make updates with fixtures? #19

nextor2k opened this issue Oct 30, 2014 · 5 comments

Comments

@nextor2k
Copy link

As the title says. I'm trying to update a record, but the rule of fixture makes him fetch the data that I am wanting to update. So finding no record to make an update. How do I tell which fields it must fetch and what it should perform the update?

{
"model": "Project",
"buildOptions": {
"isNewRecord": false
},
"saveOptions": {
"fields": ["personId"]
},
"data": {
"name": "Avengers" <-- Field that i want to do the where,
"person": { <-- Field i want to update (its a personId)
"name": "Spider Man"
}
}
}

@domasx2
Copy link
Owner

domasx2 commented Nov 3, 2014

Hey, no such feature is available or planned.
My original intention for this is to populate test data, or set up initial data on a fresh install of an app.
I'm curious, what's your use case for updates?

@nextor2k
Copy link
Author

nextor2k commented Nov 3, 2014

In my case, I have a table of person who have project and project contains person. So I need to feed the ProjectID in person and in personId in project.

So in the fixtures is first created the project of the person, then I have to update this project with the personId. The system is complex and I need both of them

@domasx2
Copy link
Owner

domasx2 commented Nov 3, 2014

I think the simpler and more conventional solution would be to normalise your data stucture and have either only person contain a project, or only project contain a person

@nextor2k
Copy link
Author

nextor2k commented Nov 3, 2014

I know. is difficult to explain the business rule. I really need the information in both tables. But that's okay. I'll find a way, I was just wondering if you had this option and I was not realizing.

thx dude :)

@domasx2
Copy link
Owner

domasx2 commented Nov 3, 2014

I see, good luck :)

@domasx2 domasx2 closed this as completed Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants