Grails
  1. Grails
  2. GRAILS-3802

Add custom constraints based on convetion

    Details

    • Type: New Feature New Feature
    • Status: Reopened
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.1-beta2
    • Fix Version/s: None
    • Component/s: Persistence
    • Labels:
      None

      Description

      Currently custom constraints can be added using the Config.groovy class as described inhttp://www.zorched.net/2008/01/26/custom-validators-in-grails-in-a-single-app/

      E.g.: org.codehaus.groovy.grails.validation.ConstrainedProperty.registerNewConstraint(
      PostalCodeConstraint.POSTAL_CODE_CONSTRAINT, PostalCodeConstraint.class)

      I think it would be great if constraints can be added by convention.
      E.g. add the PostcodeConstraint to some folder/package (utils?) and that Grails picks it up automatically and registers it. Just like it does it with the Codecs.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Burt Beckwith
            Reporter:
            Marcel Overdijk
          • Votes:
            13 Vote for this issue
            Watchers:
            14 Start watching this issue

            Dates

            • Created:
              Updated:
              Last Reviewed:

              Development