Skip to content

Commit

Permalink
Fixes to domain class reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed Jun 11, 2015
1 parent 2fdcfe2 commit ec5ab8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
public class DomainClassArtefactHandler extends ArtefactHandlerAdapter implements GrailsApplicationAware {

public static final String TYPE = "Domain";
public static final String PLUGIN_NAME = "domainClass";

private Map<String, Object> defaultConstraints;
public DomainClassArtefactHandler() {
Expand All @@ -58,6 +59,11 @@ public void setGrailsApplication(GrailsApplication grailsApplication) {
}
}

@Override
public String getPluginName() {
return PLUGIN_NAME;
}

@Override
@SuppressWarnings("rawtypes")
public GrailsClass newArtefactClass(Class artefactClass) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ class DomainClassGrailsPlugin extends Plugin {
def dependsOn = [i18n:version]
def loadAfter = ['controllers', 'dataSource']

GrailsApplication grailsApplication

Closure doWithSpring() {{->

def application = grailsApplication
Expand Down Expand Up @@ -137,7 +135,7 @@ class DomainClassGrailsPlugin extends Plugin {
application = ref("grailsApplication", true)
}
}
application.refreshConstraints()
grailsApplication.refreshConstraints()
}

void onConfigChange(Map<String, Object> event) {
Expand Down

0 comments on commit ec5ab8d

Please sign in to comment.