title: Grails 2.x createCriteria 'or' doesn't work for nested associations
body: <p>It seems that in Grails 2.x, if you have a domain class association, and you try to run a createCriteria using <code>or</code> on that relation + another query, the <code>or</code> will ignore the other query and just use the results of the nested association.  I realize this may be a little confusing, so here is an example:</p>
  
  <pre><code>class Passenger {
      Long id
      Boolean isDriving
  }
  
  class Car {
      Long id
      Passenger passenger
      Boolean isMoving
  
      static constraints = {
          passenger nullable: true
      }
  }
  </code></pre>
  
  <p>and a test:</p>
  
  <pre><code>class CarIntegrationTests {
      @Test
      void testCar() {
      Passenger passenger1 = new Passenger(isDriving: true)
      passenger1.save()
  
      Car car1 = new Car(passenger: passenger1, isMoving: false)
      Car car2 = new Car(isMoving: true)
  
      car1.save()
      car2.save()
  
          def queryResults = Car.createCriteria().list() {
              or {
                  eq('isMoving', true)// This by itself works
  
                  passenger {// And this by itself works
                      eq('isDriving', true)
                  }
              }// But OR'd, it only returns the results of the nested part
          }
  
          assertEquals 2, queryResults.size() // Returns 1
      }
  }
  </code></pre>
  
  <p>This same code worked in older versions of Grails, but doesn't not seem to work now -- does anyone know of a good workaround to this, other than running multiple queries?</p>