1
1
'use strict' ;
2
2
3
3
var 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' ) ;
6
6
7
7
/**
8
8
* Populate database with sample application data
9
9
*/
10
10
11
11
//Clear old things, then add things in
12
12
Thing . 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
+ ) ;
37
37
} ) ;
38
38
< % if ( mongo && mongoPassportUser ) { % >
39
39
// Clear old users, then add a default user
40
40
User . find ( { } ) . remove ( function ( ) {
41
- User . create ( {
42
- provider : 'local' ,
43
- name : 'Test User' ,
41
+ User . create ( {
42
+ provider : 'local' ,
43
+ name : 'Test User' ,
44
44
45
45
password : 'test'
46
- } , function ( ) {
47
- console . log ( 'finished populating users' ) ;
48
- }
49
- ) ;
46
+ } , function ( ) { 41
47
+ console . log ( 'finished populating users' ) ;
48
+ }
49
+ ) ;
50
50
} ) ;
51
51
< % } % >
0 commit comments