Skip to content
New issue

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

GRAILS-2808: Validation of collection minSize works only after entity was persisted #2115

Closed
graemerocher opened this issue Apr 11, 2008 · 5 comments

Comments

@graemerocher
Copy link
Member

Original Reporter: vlad.shevchenko
Environment: Grails 1.0.2, Java 1.5.0_13, Mac OS X 10.5.2
Version: 1.0.2
Migrated From: http://jira.grails.org/browse/GRAILS-2808

I have domain like:

{noformat}
class Profile {
String name

```
static hasMany = [categories: Category]

static constraints = {
name(size: 6..30)
categories(minSize: 1)

}
```

{noformat}

When I trying to save with correct name – entity saved successfully! Then I trying update it with no changes, and only now got validation error messages about minimum size of collection.

@graemerocher
Copy link
Member Author

pledbrook said:
Could you please attach a reproducable example? Thanks.

@graemerocher
Copy link
Member Author

graemerocher said:
I think the workarounds Peter provides a valid to resolve this issue

@graemerocher
Copy link
Member Author

nicholas said:
I think this should be fixed somehow since this is really confusing. The minSize attribute of collections is still only working when nullable: false is set.

@graemerocher
Copy link
Member Author

brownj said:
FYI... I have opened it up for discussion at https://groups.google.com/forum/#!topic/grails-dev-discuss/evQx2tz-DxI.

@graemerocher
Copy link
Member Author

rainer said:
Thank you very much Jeff, it gave me some headaches this afternoon ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant