We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class mytest { def my_data = "123" static hasMany = [childItems: mytest] static constraints = { childItems minSize: 1 } } 2. execute the following code
def mytest = new mytest() mytest.save(failOnError: true, flush: true) def result = mytest.validate()
According http://docs.grails.org/3.1.1/ref/Constraints/minSize.html
minSize: Sets the minimum size of a collection or number property
Hence result should be false
result is true
The text was updated successfully, but these errors were encountered:
If minSize is set to 2 and you add just 1 item, does validation fail?
minSize
Sorry, something went wrong.
Yes it fails as expected. Guess you know why you are asking ;-)
Guess you know why you are asking
Correct.
No branches or pull requests
Steps to Reproduce
class mytest {
def my_data = "123"
static hasMany = [childItems: mytest]
static constraints = {
childItems minSize: 1
}
}
2. execute the following code
def mytest = new mytest()
mytest.save(failOnError: true, flush: true)
def result = mytest.validate()
Expected Behaviour
According http://docs.grails.org/3.1.1/ref/Constraints/minSize.html
minSize: Sets the minimum size of a collection or number property
Hence result should be false
Actual Behaviour
result is true
Environment Information
The text was updated successfully, but these errors were encountered: