var ServiceModel = require('../core/service-model');
module.exports = ServiceModel.create("Story", {

  url: '/story',

  userSpace: {
    field: "_user"
  },
  timestamps: true,

  schema: {
    id: {
      type: Number,
      required: true,
      min: 1,
      autoIncrement: true,
      idField: true
    },
    title: {
      type: String,
      required: true
    },
    description: String,
    status: {
      type: String,
      required: true,
      default: 'new',
      enum: ['new', 'progress', 'done', 'hold']
    },
    createdDate: {
      type: Date,
      required: true,
      default: Date.now
    }
  },

  permissions: function() {
    return {
      item: {
        read: ['None'],
        write: ['None'],
        delete: ['None']
      },
      bulk: {
        read: ['None'],
        write: ['None'],
        delete: ['None']
      }
    };
  },

  configure: function() {
    console.log('configure');
    // this.model.path('name').set(function(v) {
    //   return capitalize(v);
    // });
  }
});
@@ -620,16 +620,19 @@
 %0A  %7D,%0A%0A 
+ //
  permiss
@@ -651,16 +651,19 @@
 on() %7B%0A 
+ //
    retur
@@ -663,24 +663,27 @@
   return %7B%0A 
+ //
      item: %7B
@@ -680,24 +680,27 @@
    item: %7B%0A 
+ //
        read:
@@ -704,38 +704,41 @@
 ad: %5B'None'%5D,%0A  
+//
       
+ 
 write: %5B'None'%5D,
@@ -731,32 +731,35 @@
 ite: %5B'None'%5D,%0A 
+ //
        delete: %5B
@@ -763,24 +763,27 @@
 : %5B'None'%5D%0A 
+ //
      %7D,%0A    
@@ -780,20 +780,23 @@
    %7D,%0A  
+//
     
+ 
 bulk: %7B%0A
@@ -792,24 +792,27 @@
    bulk: %7B%0A 
+ //
        read:
@@ -819,24 +819,27 @@
  %5B'None'%5D,%0A 
+ //
        write
@@ -852,22 +852,25 @@
 ne'%5D,%0A  
+//
       
+ 
 delete: 
@@ -883,16 +883,19 @@
 '%5D%0A 
+ //
      %7D%0A 
    %7D
@@ -894,15 +894,21 @@
  %7D%0A 
+ //
    %7D;%0A 
+ //
  %7D,%0A
@@ -938,38 +938,8 @@
 ) %7B%0A
-    console.log('configure');%0A
     

Check in @ Fri Apr 29 10:34:20 IST 2016