Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

49 lines (43 sloc) 1.343 kb
Copyright (c) 2012, Luanne Misquitta
All rights reserved. See License.txt
import com.herokuapp.flavorwocky.Category
import com.herokuapp.flavorwocky.Ingredient
import com.herokuapp.flavorwocky.LatestPairing
import org.neo4j.graphdb.*
class BootStrap {
* Initialize the app
def init = { servletContext ->
//check if there are categories in the db
if (Category.count()<=0) {
def destroy = {
* Create categories and link to the reference node.
private void createInitialCategories() {
//todo: is this really being batched? need to verify
Category.withTransaction {
'Herbs and spices':'yellowgreen',
'Eggs and dairy':'wheat',
'Nuts and Grains':'orange',
'Chocolate, Bread and Pastry':'saddlebrown'
].each {
new Category(name: it.key, catColor: it.value).save(failOnError: true)
Jump to Line
Something went wrong with that request. Please try again.