You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
piotrgajow
changed the title
Building domain subclasses does not add base instance properly
Calling get on base class after building subclass instance does not work
Jan 4, 2018
Having two domain classes, when one extends the other using tablePerHierarchy mechanism produces strange results when building test data.
How to reproduce:
Base
Subclass
extendingBase
Subclass
def instance = Subclass.build()
Base.get(instance.id)
results innull
whereas it should returninstance
objectWorkaround:
Running
Base.list()
orSubclass.list()
before theget
fixes the issue.GitHub with reproduction:
https://github.com/piotrgajow/Sandbox/tree/grails-BuildTestDataPlugin-InheritanceIssue
All of tests from this specification pass.
Environment:
Plugin: 3.0.1
OS: Windows 10
Gradle: 3.4.1
Grails: 3.2.8
Groovy: 2.4.7
JVM: 1.8.0_131
The text was updated successfully, but these errors were encountered: