I just wanted to check that there was nothing wrong with a model having 2 belongsTo:
@belongsTo 'claim'
@belongsTo 'buyer'
I ask because I have this and saving does not produce the json it should:
create: =>
alert @claim
CT.Buyer.find $("#buyer_id").val(), (err, buyer) =>
@bid.set 'claim', @claim
@bid.set 'buyer', buyer
@bid.save()
return false
The alert @claim
shows me clearly that @claim
is correct and contains the Claim I expect. But the json sent when save()
is called looks like:
{buyer_id:52c86c74-2425-11e1-8b23-0021cc5da1e1, amount:123}
It is not sending claim_id
for some reason.