Q:

remove child from hasMany relationship

How do you remove a child from a hasMany relationship without deleting the child?
I have tried setting the foreign_key of the child to null. I have also tried using removeObject on the parent relationship.
here is an example.
App.Invoice = DS.Model.extend
  lines: DS.hasMany('App.Line')

App.Line = DS.Model.extend
  invoice: DS.belongsTo('App.Invoice')

App.InvoiceController = Ember.Controller.extend
  removeLine: (line) ->
    @get('content.lines').removeObject(line)
    line.set('invoice', null)
    @get('store').commit()

App.InvoiceEditView = Ember.View.extend
  templateName: 'invoice'

App.LineView = Ember.View.extend
  tagName: 'tr'
  templateName: 'line'

#invoice template
<table>
    {{#each content.tasks}}
      {{view App.LineView}}
    {{/each}}
</table>

#line template
<td><a {{action "removeLine" view.context}}>remove</a></td>
<td>{{description}}</td>
<td>{{price}}</td>
<td>{{price}}</td>

I am currently using
jquery 1.8.2
ember.js v1.0.pre-4
ember-data v11

A:

It seems that setting invoice to an empty string works. 
 App.InvoiceController = Ember.Controller.extend
   removeLine: (line) ->
     @get('content.lines').removeObject(line)
     line.set('invoice', '')
     @get('store').commit()

