我正在尝试实现类似的东西,但错误正在提升:
PersonController.Groovy
class PersonController
{
static scaffold = Person
}
Person.groovy
class Person
{
String function
static constraints = {
function (inList:[Function.findAllByType("JENKIN")])
}
}
抛出异常:
...
Caused By: Method on class [com.test.domain.Person] was used outside of a Grails application. If running in the context of a test using the mocking API or bootstrap Grails correctly.
...
可以在inList约束中使用findBy方法吗?
由于