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

        Marcel Overdijk created issue -
        Graeme Rocher made changes -
        Field Original Value New Value
        Fix Version/s 1.1-beta3 [ 14824 ]
        Priority Major [ 3 ] Critical [ 2 ]
        Graeme Rocher made changes -
        Fix Version/s 1.1-beta3 [ 14824 ]
        Fix Version/s 1.1-RC1 [ 14929 ]
        Peter Ledbrook made changes -
        Fix Version/s 1.1-RC1 [ 14929 ]
        Priority Critical [ 2 ] Major [ 3 ]
        Fix Version/s 1.2 [ 14155 ]
        Graeme Rocher made changes -
        Fix Version/s 1.2-M1 [ 14155 ]
        Fix Version/s 1.2-M2 [ 15425 ]
        Graeme Rocher made changes -
        Fix Version/s 1.2-M3 [ 15547 ]
        Fix Version/s 1.2-M2 [ 15425 ]
        Graeme Rocher made changes -
        Priority Major [ 3 ] Minor [ 4 ]
        Graeme Rocher made changes -
        Fix Version/s 1.2-RC1 [ 15774 ]
        Fix Version/s 1.2-M3 [ 15547 ]
        Graeme Rocher made changes -
        Fix Version/s 1.2-RC1 [ 15959 ]
        Fix Version/s 1.2-M4 [ 15774 ]
        Graeme Rocher made changes -
        Fix Version/s 1.2-RC1 [ 15959 ]
        Fix Version/s 1.3 [ 15400 ]
        Graeme Rocher made changes -
        Fix Version/s 1.3-RC1 [ 16274 ]
        Fix Version/s 1.3-M1 [ 15400 ]
        Burt Beckwith made changes -
        Resolution Won't Fix [ 2 ]
        Assignee Graeme Rocher [ graemerocher ] Burt Beckwith [ burtbeckwith ]
        Fix Version/s 1.3-RC1 [ 16274 ]
        Status Open [ 1 ] Closed [ 6 ]
        Burt Beckwith made changes -
        Status Closed [ 6 ] Reopened [ 4 ]
        Resolution Won't Fix [ 2 ]
        Contegix Support made changes -
        Project Import Thu Mar 24 21:22:24 CDT 2011 [ 1301019744151 ]
        Burt Beckwith made changes -
        Workflow jira [ 34243 ] Grails [ 41622 ]
        Burt Beckwith made changes -
        Workflow Grails [ 41622 ] Copy of Grails [ 49073 ]
        Burt Beckwith made changes -
        Workflow Copy of Grails [ 49073 ] Grails [ 56483 ]
        Burt Beckwith made changes -
        Workflow Grails [ 56483 ] Grails2 [ 64042 ]
        Burt Beckwith made changes -
        Workflow Grails2 [ 64042 ] jira [ 78194 ]
        Burt Beckwith made changes -
        Workflow jira [ 78194 ] Grails2 [ 80227 ]
        Peter Ledbrook made changes -
        Last Reviewed 01/Jan/10
        Peter Ledbrook made changes -
        Workflow Grails2 [ 80227 ] jira [ 88735 ]
        Peter Ledbrook made changes -
        Workflow jira [ 88735 ] Grails2 [ 96893 ]

          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