Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import grailsbb.*
- class BootStrap {
- def springSecurityService
- def init = { servletContext ->
- def user = new User(
- firstName:"Chris",
- lastName:"Jordan",
- email:"chris.s.jordan@gmail.com",
- username:"cjordan",
- password:springSecurityService.encodePassword("csj001"),
- enabled: true
- ).save()
- def forum = new Forum(title:"Grails",description:"Stuff about Grails").save()
- forum.addToModerators(user);
- def subForum = new Forum(parent:forum,title:"Grails Development", description:"This is where we will discuss development revolving around the Grails framework.").save()
- //forum.addToSubForums(subForum); // This is no longer needed sine we have defined a bidirectional relationship
- def thread = new Thread(subject:"GrailsBB Rocks!", forum:subForum, author:user).save()
- def post = new Post(subject:thread.subject,body:"This is the body!",author:user,thread:thread).save()
- }
- def destroy = {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement