Grails
  1. Grails
  2. GRAILS-8286

groovy.lang.MissingMethodException when calling method isAttached on domain class

    Details

      Description

      Steps to reproduce:
      1) Create a fresh grails 2.0.RC1 application

      grails create-app grails2-test-app; cd grails2-test-app
      

      2) Create a domain class:

      grails create-domain-class grails2.test.domain.Book
      

      3) Add a property to the domain class:

      Book.groovy
      class Book {
        String title
        static constraints = { }
      }
      

      4) Create a controller:

      grails create-controller grails2.test.controller.Book
      

      5) Add the following code to the generated index action.

      BookController.groovy
      def index() { 
        def book = new grails2.test.domain.Book(title: 'yyyy')
        println book.isDirty()
        println book.isAttached()
        render 'If you do not see this message something went wrong!'
      }
      

      5) Run the application and navigate to this URL in your browser: http://localhost:8080/grails2-test-app/book/index

      As you can see on your browser, the exception is thrown only in the call to method isAttached. Other domain class dynamic methods like isDirty does not throw exception. According to grails 2.0.0RC1 http://grails.org/doc/2.0.0.RC1/ref/Domain%20Classes/isAttached.html the method is supported in this version.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Ignacio Arces
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development