Ignore:
Timestamp:
Feb 9, 2009, 8:31:32 PM (16 years ago)
Author:
gav
Message:

Add PersonGroup/Type? to Bootstrap.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/TaskRewrite/src/grails-app/conf/BootStrap.groovy

    r59 r64  
    3434   
    3535        //TypeOfPersonGroup
    36 //         new PersonGroupType(name:"Department").save()
    37 //         new PersonGroupType(name:"Contractor").save()
    38 //         new PersonGroupType(name:"ProjectTeam").save()
     36        def personGroupTypeInstance
     37        personGroupTypeInstance = new PersonGroupType(name:"Department")
     38        BootStrapSaveAndTest(personGroupTypeInstance)
     39        personGroupTypeInstance = new PersonGroupType(name:"Contractor")
     40        BootStrapSaveAndTest(personGroupTypeInstance)
     41        personGroupTypeInstance = new PersonGroupType(name:"ProjectTeam")
     42        BootStrapSaveAndTest(personGroupTypeInstance)
    3943   
    4044        //PersonGroup
    41 //         new PersonGroup(personGroupType:PersonGroupType.findByName("Department"),
    42 //                         name:"Electrical").save()
    43 //         new PersonGroup(personGroupType:PersonGroupType.get(2),
    44 //                         name:"Kewl AirCon Guys").save()
    45 //         new PersonGroup(personGroupType:PersonGroupType.get(3),
    46 //                         name:"gnuMims").save()
     45        def personGroupInstance
     46        personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.findByName("Department"),
     47                        name:"Electrical")
     48        BootStrapSaveAndTest(personGroupInstance)
     49        personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.findByName("Department"),
     50                        name:"Mechanical")
     51        BootStrapSaveAndTest(personGroupInstance)
     52        personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.findByName("Department"),
     53                        name:"Production")
     54        BootStrapSaveAndTest(personGroupInstance)
     55        personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(2),
     56                        name:"Kewl AirCon Guys")
     57        BootStrapSaveAndTest(personGroupInstance)
     58        personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(3),
     59                        name:"gnuMims")
     60        BootStrapSaveAndTest(personGroupInstance)
    4761
    4862        //Authority
     
    6983        personInstance.addToAuthorities(Authority.get(1))
    7084        personInstance.addToAuthorities(Authority.get(2))
     85        personInstance.addToPersonGroups(PersonGroup.findByName("gnuMims"))
    7186
    7287        personInstance = new Person(loginName:"user",
     
    7792        BootStrapSaveAndTest(personInstance)
    7893        personInstance.addToAuthorities(Authority.get(2))
     94        personInstance.addToPersonGroups(PersonGroup.findByName("Electrical"))
    7995
    8096        personInstance = new Person(loginName:"craig",
     
    85101        BootStrapSaveAndTest(personInstance)
    86102        personInstance.addToAuthorities(Authority.get(2))
     103        personInstance.addToPersonGroups(PersonGroup.findByName("Electrical"))
    87104
    88105        personInstance = new Person(loginName:"joe",
     
    93110        BootStrapSaveAndTest(personInstance)
    94111        personInstance.addToAuthorities(Authority.get(2))
     112        personInstance.addToPersonGroups(PersonGroup.findByName("Mechanical"))
    95113
    96114        personInstance = new Person(loginName:"mann",
     
    101119        BootStrapSaveAndTest(personInstance)
    102120        personInstance.addToAuthorities(Authority.get(2))
    103 
     121        personInstance.addToPersonGroups(PersonGroup.findByName("Production"))
    104122               
    105123        //TaskGroup
Note: See TracChangeset for help on using the changeset viewer.