I have domain classes => many-to-many and associate them using addTo.
class Books {
static belongsTo = Author
}
class Author {
static belongsTo = Book
static hasMany = [books: Book]
}
Controller:
author.addToBooks(mybook).save()
=> I want to check if mybook is already added to author. Is the a way to check if the book is already added to author (hopefully not using findBy)? Something like
if (author.isAdded(mybook))
Thanks.