Closed jimsynz closed 5 years ago
(ping @ghempton)
Sorry for the delay.
Hmmm.... this is certainly strange. Seems like it is removing the inverse for some reason. Can you post the json that is being returned?
Hey @ghempton.
So, here's the JSON for /api/v1/parts?number=234
, I presume that's what you're interested in?
{
"parts":[
{
"id":1,
"number":"1234",
"name":"Exclamation Lamp",
"description":null,
"price":{
"money":{
"currency":"USD",
"fractional":0
}
},
"cost":{
"money":{
"currency":"USD",
"fractional":0
}
},
"work_centre_id":1,
"factory_id":1,
"bill_of_materials_entry_ids":[
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13
]
},
{
"id":2,
"number":"2345",
"name":"Exclamation Lamp Sides",
"description":null,
"price":{
"money":{
"currency":"USD",
"fractional":0
}
},
"cost":{
"money":{
"currency":"USD",
"fractional":0
}
},
"work_centre_id":4,
"factory_id":1,
"bill_of_materials_entry_ids":[
14
]
},
{
"id":3,
"number":"2346",
"name":"Exclamation Lamp Front",
"description":null,
"price":{
"money":{
"currency":"USD",
"fractional":0
}
},
"cost":{
"money":{
"currency":"USD",
"fractional":0
}
},
"work_centre_id":4,
"factory_id":1,
"bill_of_materials_entry_ids":[
15
]
},
{
"id":4,
"number":"2347",
"name":"Exclamation Lamp Back",
"description":null,
"price":{
"money":{
"currency":"USD",
"fractional":0
}
},
"cost":{
"money":{
"currency":"USD",
"fractional":0
}
},
"work_centre_id":4,
"factory_id":1,
"bill_of_materials_entry_ids":[
16
]
},
{
"id":5,
"number":"2348",
"name":"Exclamation Lamp Diffuser",
"description":null,
"price":{
"money":{
"currency":"USD",
"fractional":0
}
},
"cost":{
"money":{
"currency":"USD",
"fractional":0
}
},
"work_centre_id":4,
"factory_id":1,
"bill_of_materials_entry_ids":[
17
]
}
]
}
I'm kind of stumped on this one. We do what is ostensibly the same thing in many places in our app....
Seems like there is a merging issue here. New data is coming back for the already associated part and it is overwriting the existing data (and more).
I think the only way for me to tackle this one is to try and get a test case to repro it and come up with a fix.
Happy to show you the code via Screenhero. Otherwise I'll try and build a repro for you.
I'm in the middle of a big crunch right now so I don't have a ton of free time. Normally I'd totally be down for a screenhero session, but for the short term a repro would be great. Cheers.
No problem. I'll see what I can come up with.
Also, I would try using master if you aren't already.
Hey there. I'm working on a completion system, using query to find the records we need.
In this case, we're searching by the
number
property ofApp.Part
using@session.query('part', number: @get('partNumber')
which works fine. Then I can add the order line to the order and it looks thus:Then, as soon as I do the search a second time, all the parts appear to disappear from the collection:
In summary
All behaves as expected if I do the following:
It raises an exception if I try and associate it.
Is this expected behaviour? It certainly surprised me.
Thanks! :heart: your work.