Skip to content

Commit

Permalink
Adding some contstraints and relationships in the domain model
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Creeger committed Aug 15, 2011
1 parent 28b400d commit 019a122
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 72 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
target
cafe-centro*.i*
*.iml
data
7 changes: 0 additions & 7 deletions grails-app/domain/org/cafe-centro/Artist.groovy

This file was deleted.

7 changes: 0 additions & 7 deletions grails-app/domain/org/cafe-centro/Event.groovy

This file was deleted.

7 changes: 0 additions & 7 deletions grails-app/domain/org/cafe-centro/Venue.groovy

This file was deleted.

10 changes: 10 additions & 0 deletions grails-app/domain/org/cafeCentro/Artist.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.cafeCentro

class Artist {

String name;

static constraints = {
name(blank: false)
}
}
18 changes: 18 additions & 0 deletions grails-app/domain/org/cafeCentro/Event.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.cafeCentro

class Event {

static hasMany = [artists:Artist]

Date lastUpdated
Date dateCreated

Date startTime
Venue venue
String name

static constraints = {
startTime(min: new Date())
name(blank: false)
}
}
16 changes: 16 additions & 0 deletions grails-app/domain/org/cafeCentro/Venue.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.cafeCentro

class Venue {

String name
String address1
String address2
String city
String region
String zipCode
String coords

static constraints = {
zipCode(matches: /\d{5}/)
}
}
17 changes: 0 additions & 17 deletions test/unit/org/cafe-centro/ArtistTests.groovy

This file was deleted.

17 changes: 0 additions & 17 deletions test/unit/org/cafe-centro/EventTests.groovy

This file was deleted.

17 changes: 0 additions & 17 deletions test/unit/org/cafe-centro/VenueTests.groovy

This file was deleted.

0 comments on commit 019a122

Please sign in to comment.