title: What's the proper way to set a parent property in Backbone?
body: <p>I have a JSON file that will create my <code>ParentModel</code> as well as populate the child <code>Records</code> collection.</p>
  
  <pre><code>ParentModel : Backbone.Model.extend({
    initialize: function() {
      this.set({ records: new Records(this.get("records")) });
    }
  });
  </code></pre>
  
  <p>And the Records collection is just a basic Backbone collection that maps to a Record model.</p>
  
  <p>The problem is that I need the child to know about the parent, so each <code>Record</code> model has to have a parent property on it. So for now I've just been adding this to the bottom of the initialize method:</p>
  
  <pre><code>var self = this;
  this.get("records").each(function(record) {
    record.set("parent", self);
  });
  </code></pre>
  
  <p>This works fine, but when I'm creating a new record I'd rather not have to remember to include those 4 lines.</p>
  
  <p><a href="https://stackoverflow.com/a/10399476/74022">This answer</a> says I can override the initialize method to take in additional parameters, but I'm not quite sure how I would get Backbone to automatically pass in the ParentModel to the overridden initialize method. Can anyone provide an example on how to do that?</p>
  
  <p>I've heard of <a href="https://github.com/PaulUithol/Backbone-relational" rel="nofollow noreferrer">Backbone-relational</a> which might help do what I want, but that's another 23kb to include. If that's the better way to go I'll look at implementing it, but otherwise I'd prefer a simpler solution if one is available.</p>
  
  <p>This needs to work whether I create a new <code>ParentModel</code> record through code, or if it's being automatically created by a JSON feed.</p>