11'use strict' ;
22
33var mongoose = require ( 'mongoose' ) , < % if ( mongo && mongoPassportUser ) { % >
4- User = mongoose . model ( 'User' ) , < % } % >
5- Thing = mongoose . model ( 'Thing' ) ;
4+ User = mongoose . model ( 'User' ) , < % } % >
5+ Thing = mongoose . model ( 'Thing' ) ;
66
77/**
88 * Populate database with sample application data
99 */
1010
1111//Clear old things, then add things in
1212Thing . find ( { } ) . remove ( function ( ) {
13- Thing . create ( {
14- name : 'HTML5 Boilerplate' ,
15- info : 'HTML5 Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites.' ,
16- awesomeness : 10
17- } , {
18- name : 'AngularJS' ,
19- info : 'AngularJS is a toolset for building the framework most suited to your application development.' ,
20- awesomeness : 10
21- } , {
22- name : 'Karma' ,
23- info : 'Spectacular Test Runner for JavaScript.' ,
24- awesomeness : 10
25- } , {
26- name : 'Express' ,
27- info : 'Flexible and minimalist web application framework for node.js.' ,
28- awesomeness : 10
29- } , {
30- name : 'MongoDB + Mongoose' ,
31- info : 'An excellent document database. Combined with Mongoose to simplify adding validation and business logic.' ,
32- awesomeness : 10
33- } , function ( ) {
34- console . log ( 'finished populating things' ) ;
35- }
36- ) ;
13+ Thing . create ( {
14+ name : 'HTML5 Boilerplate' ,
15+ info : 'HTML5 Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites.' ,
16+ awesomeness : 10
17+ } , {
18+ name : 'AngularJS' ,
19+ info : 'AngularJS is a toolset for building the framework most suited to your application development.' ,
20+ awesomeness : 10
21+ } , {
22+ name : 'Karma' ,
23+ info : 'Spectacular Test Runner for JavaScript.' ,
24+ awesomeness : 10
25+ } , {
26+ name : 'Express' ,
27+ info : 'Flexible and minimalist web application framework for node.js.' ,
28+ awesomeness : 10
29+ } , {
30+ name : 'MongoDB + Mongoose' ,
31+ info : 'An excellent document database. Combined with Mongoose to simplify adding validation and business logic.' ,
32+ awesomeness : 10
33+ } , function ( ) {
34+ console . log ( 'finished populating things' ) ;
35+ }
36+ ) ;
3737} ) ;
3838< % if ( mongo && mongoPassportUser ) { % >
3939// Clear old users, then add a default user
4040User . find ( { } ) . remove ( function ( ) {
41- User . create ( {
42- provider : 'local' ,
43- name : 'Test User' ,
41+ User . create ( {
42+ provider : 'local' ,
43+ name : 'Test User' ,
4444 email : 'test@test.com' ,
4545 password : 'test'
46- } , function ( ) {
47- console . log ( 'finished populating users' ) ;
48- }
49- ) ;
46+ } , function ( ) { 41
47+ console . log ( 'finished populating users' ) ;
48+ }
49+ ) ;
5050} ) ;
5151< % } % >
0 commit comments