title: Grails 3.1.1 - Dirty checking not working when model class extends another groovy class
body: <p>I have a domain class which extends another groovy class with same name but in different package in a different library.</p>
  
  <p>The problem is when I modify instances on the domain class, it is not marked as dirty &amp; hence changes are not persisted.</p>
  
  <p>I have read that grails 3 release has some enhancements to dirty checking &amp; this could be a bug or I am missing something.</p>
  
  <p>New objects are saved properly without any issues, I have used <strong>isDirty()</strong> method on modified domain object as well as modified properties &amp; both return <strong>false</strong>. Objects are attached to the session, confirmed with <strong>isAttached()</strong>.</p>
  
  <p>To reproduce, I created a test project with following code &amp; tried updating the object from default grails views that are generated using scaffolding, but still the changes are not persisted.</p>
  
  <p><strong>Note:</strong> I have done similar stuff in Grails 2.4 &amp; it used to work.</p>
  
  <p><strong>Domain class is as follows:</strong></p>
  
  <pre><code>package com.perseus
  
  class Derived extends Base{
  
      static constraints = {
          name blank: false, nullable: false
      }
  
  }
  </code></pre>
  
  <p><strong>Base class in src/main/groovy</strong>:</p>
  
  <pre><code>package com.perseus
  
  class Base implements Serializable {
  
      private static final long serialVersionUID = 1L
  
      String name
  
  }
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>package com.perseus
  
  class DerivedController {
  
      static scaffold = Derived
  
  }
  </code></pre>
  
  <p><strong>Link to github <a href="https://github.com/Pritesh-Mhatre/grails" rel="nofollow noreferrer">project</a>.</strong></p>
  
  <p><strong>Isssue</strong>: Model is not marked dirty, even if it has been modified. This happens when a model class extends another groovy class.</p>
  
  <p>How to reproduce:</p>
  
  <ol>
  <li>Run the app. </li>
  <li>Create a new model object (model name is Derived)</li>
  <li>Modify the object using edit view &amp; click Update.</li>
  <li>You will see that modifications are not persisted.</li>
  </ol>