Commit 0343f123

mo khan <mo@mokhan.ca>
2014-06-29 03:36:19
add defaults for backbone models.
1 parent 3ee154e
Changed files (2)
app
assets
javascripts
app/assets/javascripts/backbone/models/cake.js.coffee
@@ -2,9 +2,14 @@ class CakeSide.Models.Cake extends Backbone.Model
   paramRoot: 'cake'
 
   defaults:
+    id: null
     name: null
     watermark: null
     story: null
+    created_at: null
+    updated_at: null
+    is_restricted: false
+    category_id: null
 
   validate: (attributes, options) ->
     return "Name can't be blank" unless attributes.name && attributes.name.trim()
app/assets/javascripts/backbone/models/photo.js.coffee
@@ -3,7 +3,7 @@ class CakeSide.Models.Photo extends Backbone.Model
   fileAttribute: 'image'
 
   defaults:
-    id: 0
+    id: null
     content_type: null
     original_filename: null
     thumb_url: null