From 2d13a72bb28c150e90cb257ba080ff4691bfe52c Mon Sep 17 00:00:00 2001 From: Sven Arnold Date: Sun, 12 Apr 2009 21:13:12 +0200 Subject: [PATCH] add unique name to configuration --- grails-app/conf/BootStrap.groovy | 2 +- grails-app/domain/PortalConfiguration.groovy | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/grails-app/conf/BootStrap.groovy b/grails-app/conf/BootStrap.groovy index f43e95a..1c0e814 100644 --- a/grails-app/conf/BootStrap.groovy +++ b/grails-app/conf/BootStrap.groovy @@ -3,7 +3,7 @@ class BootStrap { def init = { servletContext -> // initialize configuration - def config = new PortalConfiguration(title: "Schnuppe Portal", motto: "A new star is born", theme: "grey") + def config = new PortalConfiguration(name: "default", title: "Schnuppe Portal", motto: "A new star is born", theme: "grey") assert config.save() // some top level pages diff --git a/grails-app/domain/PortalConfiguration.groovy b/grails-app/domain/PortalConfiguration.groovy index 50111d7..6c25447 100644 --- a/grails-app/domain/PortalConfiguration.groovy +++ b/grails-app/domain/PortalConfiguration.groovy @@ -1,10 +1,12 @@ class PortalConfiguration { + String name String title String motto String theme static constraints = { + name(unique: true) title(nullable: false) motto(nullable: true) theme(nullable: false) -- 2.11.0