Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Groovy by registered user Lito ( 14 years ago )
package graph
import java.util.Date;
import core.Context
class GraphState {
String name
user.User author
Date dateCreated
static belongsTo = [project: core.Project]
static hasMany = [ GraphNodeList:GraphNode]
static constraints = {
name()
author()
dateCreated()
project()
}
static mapping = {
version false
}
String toString() {
return "GraphState '${name}'"
}
/**
* Формирует массив с необходимыми данными для клиента.
*
* @return Ассоциативный массив с данными
*/
def prepareToJSON() {
[
id: id,
name: name,
author: author.id,
project: project.id,
created: dateCreated
]
}
}
Revise this Paste