[Jifty-commit] jifty branch, jifty_client, updated. ac607702063340812b5503db599e7cc7148e98c2

Jifty commits jifty-commit at lists.jifty.org
Sun May 2 08:55:04 EDT 2010


The branch, jifty_client has been updated
       via  ac607702063340812b5503db599e7cc7148e98c2 (commit)
      from  f73e1f665c2340db4790d7d01bd94f102c0a0f8e (commit)

Summary of changes:
 share/web/static/js/jifty_client.js |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit ac607702063340812b5503db599e7cc7148e98c2
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sun May 2 20:55:09 2010 +0800

    Always provide the id

diff --git a/share/web/static/js/jifty_client.js b/share/web/static/js/jifty_client.js
index 462d3ee..e88d0dc 100644
--- a/share/web/static/js/jifty_client.js
+++ b/share/web/static/js/jifty_client.js
@@ -4,15 +4,19 @@ Class("JiftyModel", {
             var className = this.meta.getName();
             var actionName = "Update" + className;
 
+            // this is always required, but if someone is doing something
+            // bizarre, let them
+            if (!diff.id) {
+                diff.id = this.id;
+            }
+
             // should we abort if diff contains only id?
 
             this.meta.getClassObject().jiftyClient.runAction(actionName, diff, onSuccess, onFailure);
         },
         sync: function (onSuccess, onFailure) {
             var record = this;
-            var diff = {
-                id: this.id // we must always send this
-            };
+            var diff = {};
 
             Joose.O.eachSafe(record._original, function (value, field) {
                 if (record[field] != value) {

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list