blob: f8c7124dec2845a9da163a8696de9459fb477d4d [file] [log] [blame]
package multitenantcomposite
import grails.gorm.multitenancy.Tenants
import groovy.transform.CompileStatic
@CompileStatic
class BookController {
BookService bookService
def index() {
[:]
}
def grails() {
render view: 'books', model: model('grails')
}
def groovy() {
render view: 'books', model: model('groovy')
}
private Map<String, List<Book>> model(String tenantId) {
[books: Tenants.withId(tenantId) {
bookService.find()
}]
}
}