From 8678dd220bed4e017025fb1f7310c44d197360d4 Mon Sep 17 00:00:00 2001 From: Is Isilon Date: Tue, 2 Feb 2016 13:24:44 +0800 Subject: [PATCH] Server uses demo data --- db/seed/initial_tasks.js | 12 +++--------- public/javascripts/data/{demo.js => demo.json} | 0 2 files changed, 3 insertions(+), 9 deletions(-) rename public/javascripts/data/{demo.js => demo.json} (100%) diff --git a/db/seed/initial_tasks.js b/db/seed/initial_tasks.js index a494b23..4d13c30 100644 --- a/db/seed/initial_tasks.js +++ b/db/seed/initial_tasks.js @@ -1,16 +1,10 @@ var config = require('config'), orm = require('../../orm').configure(config.get('database')), - Tasks = require('../../db/models/task').instance(orm); + Tasks = require('../../db/models/task').instance(orm), + demoData = require('../../public/javascripts/data/demo.json'); Tasks.destroy({where: {}}).then(function() { - Tasks.bulkCreate([ - {content: 'Welcome to HackFlowy!', isCompleted: false}, - {content: 'An open-source WorkFlowy clone', isCompleted: false}, - {content: 'Built using Backbone + Socket.IO', isCompleted: false}, - {content: 'Desyncr pulled this together in a few hours to learn Backbone', isCompleted: false}, - {content: 'Feel free to try it out and hack on it', isCompleted: false}, - {content: 'Good Luck!', isCompleted: false} - ]); + Tasks.bulkCreate(demoData); }); orm.sync(); diff --git a/public/javascripts/data/demo.js b/public/javascripts/data/demo.json similarity index 100% rename from public/javascripts/data/demo.js rename to public/javascripts/data/demo.json