changeset 711:af16a257d5f6

Updated the model to have correct tree_modified value and parent_modified fields.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 08 Apr 2015 10:51:39 +0200
parents f204f30b824a
children baef70abfe71
files app/model/Messung.js app/model/Messwert.js app/model/Ort.js app/model/Probe.js app/model/Status.js app/model/Zusatzwert.js
diffstat 6 files changed, 82 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/app/model/Messung.js	Wed Apr 08 10:50:33 2015 +0200
+++ b/app/model/Messung.js	Wed Apr 08 10:51:39 2015 +0200
@@ -57,7 +57,21 @@
     }, {
         name: 'messungsIdAlt'
     }, {
-        name: 'treeModified'
+        name: 'treeModified',
+        serialize: function(value) {
+            if (value === '') {
+                return null;
+            }
+            return value;
+        }
+    }, {
+        name: 'parentModified',
+        serialize: function(value) {
+            if (value === '') {
+                return null;
+            }
+            return value;
+        }
     }],
 
     idProperty: 'id',
--- a/app/model/Messwert.js	Wed Apr 08 10:50:33 2015 +0200
+++ b/app/model/Messwert.js	Wed Apr 08 10:51:39 2015 +0200
@@ -52,7 +52,21 @@
         },
         defaultValue: new Date()
     }, {
-        name: 'treeModified'
+        name: 'treeModified',
+        serialize: function(value) {
+            if (value === '') {
+                return null;
+            }
+            return value;
+        }
+    }, {
+        name: 'parentModified',
+        serialize: function(value) {
+            if (value === '') {
+                return null;
+            }
+            return value;
+        }
     }],
 
     idProperty: 'id',
--- a/app/model/Ort.js	Wed Apr 08 10:50:33 2015 +0200
+++ b/app/model/Ort.js	Wed Apr 08 10:51:39 2015 +0200
@@ -40,7 +40,21 @@
         },
         defaultValue: new Date()
     }, {
-        name: 'treeModified'
+        name: 'treeModified',
+        serialize: function(value) {
+            if (value === '') {
+                return null;
+            }
+            return value;
+        }
+    }, {
+        name: 'parentModified',
+        serialize: function(value) {
+            if (value === '') {
+                return null;
+            }
+            return value;
+        }
     }],
 
     idProperty: 'id',
--- a/app/model/Probe.js	Wed Apr 08 10:50:33 2015 +0200
+++ b/app/model/Probe.js	Wed Apr 08 10:51:39 2015 +0200
@@ -120,7 +120,13 @@
         type: 'boolean',
         persist: false
     }, {
-        name: 'treeModified'
+        name: 'treeModified',
+        serialize: function(value) {
+            if (value === '') {
+                return null;
+            }
+            return value;
+        }
     }],
 
     idProperty: 'id',
--- a/app/model/Status.js	Wed Apr 08 10:50:33 2015 +0200
+++ b/app/model/Status.js	Wed Apr 08 10:51:39 2015 +0200
@@ -40,7 +40,21 @@
     }, {
         name: 'skommentar'
     }, {
-        name: 'treeModified'
+        name: 'treeModified',
+        serialize: function(value) {
+            if (value === '') {
+                return null;
+            }
+            return value;
+        }
+    }, {
+        name: 'parentModified',
+        serialize: function(value) {
+            if (value === '') {
+                return null;
+            }
+            return value;
+        }
     }],
 
     idProperty: 'id',
--- a/app/model/Zusatzwert.js	Wed Apr 08 10:50:33 2015 +0200
+++ b/app/model/Zusatzwert.js	Wed Apr 08 10:51:39 2015 +0200
@@ -45,7 +45,21 @@
         },
         defaultValue: new Date()
     }, {
-        name: 'treeModified'
+        name: 'treeModified',
+        serialize: function(value) {
+            if (value === '') {
+                return null;
+            }
+            return value;
+        }
+    }, {
+        name: 'parentModified',
+        serialize: function(value) {
+            if (value === '') {
+                return null;
+            }
+            return value;
+        }
     }],
 
     idProperty: 'id',

http://lada.wald.intevation.org