[Pkg-javascript-commits] [backbone] 145/281: streamlining idAttribute documentation.

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:02:06 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.9.0
in repository backbone.

commit 9a56d525b725f065bbe289ae1ff7b78dc8cb12a2
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date:   Fri Dec 30 08:51:50 2011 -0500

    streamlining idAttribute documentation.
---
 index.html | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/index.html b/index.html
index 37fdaa8..3c89fdb 100644
--- a/index.html
+++ b/index.html
@@ -689,15 +689,10 @@ if (note.has("title")) {
     <p id="Model-idAttribute">
       <b class="header">idAttribute</b><code>model.idAttribute</code>
       <br />
-      By default a model assumes its unique identifier is stored
-      under the <b>id</b> attribute. 
-      In certain situations, for example when using CouchDB where the
-      identifying attribute is called <b>_id</b>, overwriting the property
-      name is necessary.
-      Setting the <b>idAttribute</b> during a model definition will
-      set the model's <b>id</b> to the value of the idAttribute property 
-      instead. When referencing the model's <b>id</b>, continue 
-      using <b>model.id</b>.
+      A model's unique identifier is stored under the <tt>id</tt> attribute.
+      If you're directly communicating with a backend (CouchDB, MongoDB) that uses
+      a different unique key, you may set a Model's <tt>idAttribute</tt> to 
+      transparently map from that key to <tt>id</tt>. 
       
 <pre class="runnable">
 var Meal = Backbone.Model.extend({

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list