text: /**
   * Created by arunsharma on 5/2/16.
   */
  'use strict';
  
  /**
   * Module dependencies
   */
  var mongoose = require('mongoose'),
      Schema = mongoose.Schema,
      validator = require('validator');
  
  /**
   * A Validation function for local strategy properties
   */
  var validateLocalStrategyProperty = function (property) {
      return ((this.provider !== 'local' && !this.updated) || property.length);
  };
  
  /**
   * A Validation function for local strategy email
   */
  var validateLocalStrategyEmail = function (email) {
      return ((this.provider !== 'local' && !this.updated) || validator.isEmail(email, { require_tld: false }));
  };
  
  /**
   * User Schema
   */
  var CategorySchema = new Schema({
      name: {
          type: String,
          trim: true,
          default: '',
          validate: [validateLocalStrategyProperty, 'Please fill in the event name']
      },
      imgURL: {
          type: String,
          trim: true,
          default: '',
          validate: [validateLocalStrategyProperty, 'Please fill in img path']
      },
      markerImgURL : {
          type : String,
          trim : true,
          default : '',
          validate: [validateLocalStrategyProperty, 'Please fill in marker img path']
      },
      updated: {
          type: Date
      },
      created: {
          type: Date,
          default: Date.now
      }
  });
  
  /**
   * Hook a pre save method to hash the password
   */
  CategorySchema.pre('save', function (next) {
  
      next();
  });
  
  
  mongoose.model('Category', CategorySchema);
  