Skip to content

Instantly share code, notes, and snippets.

@robfletcher
Created March 17, 2010 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robfletcher/334989 to your computer and use it in GitHub Desktop.
Save robfletcher/334989 to your computer and use it in GitHub Desktop.
class TagListEditor extends PropertyEditorSupport {
void setAsText(String text) {
value = text.split(/,\s*/).collect {
Tag.findByName(it) ?: new Tag(name: it)
} as Set
}
String getAsText() {
value?.name?.join(", ")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment