Sort a collection in grails by date
the sort
method takes a closure argument, so the correct call (with implicit parens) is
pics.sort { it.dateCreated }
You can also change the default sort on the association.
In your Picture domain class add:
static mapping = {
child(sort:'dateCreated', order:'desc')
}
This is not supported for unidirectional one to many relationships, but works great for bidirectional ones.