Ignore:
Timestamp:
Oct 23, 2009, 9:49:35 AM (15 years ago)
Author:
gav
Message:

Add Department-Person relationship, update demo data and views to suite.
Add department and personGroups to Person views.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/CreateDataService.groovy

    r162 r164  
    113113        //TypeOfPersonGroup
    114114        def personGroupTypeInstance
    115             personGroupTypeInstance = new PersonGroupType(name:"Department")
     115            personGroupTypeInstance = new PersonGroupType(name:"Team")
    116116        saveAndTest(personGroupTypeInstance)
    117117            personGroupTypeInstance = new PersonGroupType(name:"Contractor")
     
    122122        //PersonGroup
    123123        def personGroupInstance
    124             personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.findByName("Department"),
     124            personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(1),
    125125                            name:"Electrical")
    126126        saveAndTest(personGroupInstance)
    127             personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.findByName("Department"),
     127            personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(1),
    128128                            name:"Mechanical")
    129129        saveAndTest(personGroupInstance)
    130             personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.findByName("Department"),
     130            personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(1),
    131131                            name:"Production")
    132132        saveAndTest(personGroupInstance)
     
    174174        personInstance.addToAuthorities(Authority.get(2))
    175175        personInstance.addToAuthorities(Authority.get(3))
    176         personInstance.addToPersonGroups(PersonGroup.findByName("gnuMims"))
     176        personInstance.addToPersonGroups(PersonGroup.get(5))
    177177
    178178        //Person #3
     
    185185        saveAndTest(personInstance)
    186186        personInstance.addToAuthorities(Authority.get(3))
    187         personInstance.addToPersonGroups(PersonGroup.findByName("Electrical"))
     187        personInstance.addToPersonGroups(PersonGroup.get(1))
    188188    }
    189189
     
    203203        saveAndTest(personInstance)
    204204        personInstance.addToAuthorities(Authority.get(3))
    205         personInstance.addToPersonGroups(PersonGroup.findByName("Electrical"))
     205        personInstance.addToPersonGroups(PersonGroup.get(1))
    206206
    207207        //Person #5
     
    214214        saveAndTest(personInstance)
    215215        personInstance.addToAuthorities(Authority.get(3))
    216         personInstance.addToPersonGroups(PersonGroup.findByName("Mechanical"))
     216        personInstance.addToPersonGroups(PersonGroup.get(2))
    217217
    218218        //Person #6
     
    225225        saveAndTest(personInstance)
    226226        personInstance.addToAuthorities(Authority.get(3))
    227         personInstance.addToPersonGroups(PersonGroup.findByName("Production"))
     227        personInstance.addToPersonGroups(PersonGroup.get(3))
    228228    }
    229229
Note: See TracChangeset for help on using the changeset viewer.