From 30b0a68701362747b75bd9c4beb8ee69fccfc3c3 Mon Sep 17 00:00:00 2001 From: Amanuel Nega_ Date: Fri, 9 Jan 2015 17:56:01 +0300 Subject: [PATCH 1/3] Fixed a typo(looks like that) --- scripts/_NgGenerate.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_NgGenerate.groovy b/scripts/_NgGenerate.groovy index 62a5bf3..9a2d0b7 100644 --- a/scripts/_NgGenerate.groovy +++ b/scripts/_NgGenerate.groovy @@ -1,7 +1,7 @@ import grails.util.GrailsNameUtils includeTargets << grailsScript("_GrailsCreateArtifacts") -includeTargets << new File("scaffoldingPluginDir/scripts/_GrailsGenerate.groovy") +includeTargets << new File("$scaffoldingPluginDir/scripts/_GrailsGenerate.groovy") includeTargets << grailsScript("_GrailsBootstrap") generateForName = null From f3626b27b7fe2b6e0d593c6ef78b76a06e6efc3e Mon Sep 17 00:00:00 2001 From: Amanuel Nega_ Date: Fri, 9 Jan 2015 17:57:20 +0300 Subject: [PATCH 2/3] cp is not bind correctly somehow! Fixex by getting cp in renderEditor --- src/templates/scaffolding/renderEditor.template | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/templates/scaffolding/renderEditor.template b/src/templates/scaffolding/renderEditor.template index 7283bb0..80f7049 100644 --- a/src/templates/scaffolding/renderEditor.template +++ b/src/templates/scaffolding/renderEditor.template @@ -1,4 +1,7 @@ <% + if (pluginManager?.hasGrailsPlugin('hibernate')) { + cp = domainClass.constrainedProperties[property.name] + } def name = prefix ? "${prefix}${property.name}" : property.name switch (property.type) { From 9c1812491ce49a0fb0adef698b2d12a3184d4ca2 Mon Sep 17 00:00:00 2001 From: Amanuel Nega_ Date: Fri, 9 Jan 2015 18:05:10 +0300 Subject: [PATCH 3/3] Changed plugin check to check for either hibernate3 or 4, the name of the hibernate plugin is hibernate4 in my install --- .../angularscaffolding/AngularTemplateGenerator.groovy | 2 +- src/templates/scaffolding/renderEditor.template | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/groovy/grails/plugin/angularscaffolding/AngularTemplateGenerator.groovy b/src/groovy/grails/plugin/angularscaffolding/AngularTemplateGenerator.groovy index 607279a..cbbf69d 100644 --- a/src/groovy/grails/plugin/angularscaffolding/AngularTemplateGenerator.groovy +++ b/src/groovy/grails/plugin/angularscaffolding/AngularTemplateGenerator.groovy @@ -20,7 +20,7 @@ class AngularTemplateGenerator extends DefaultGrailsTemplateGenerator def renderEditor = { property, prefix -> def domainClass = property.domainClass def cp - if (pluginManager?.hasGrailsPlugin('hibernate')) { + if (pluginManager?.hasGrailsPlugin('hibernate4')||pluginManager?.hasGrailsPlugin('hibernate3')) { cp = domainClass.constrainedProperties[property.name] } diff --git a/src/templates/scaffolding/renderEditor.template b/src/templates/scaffolding/renderEditor.template index 80f7049..b346117 100644 --- a/src/templates/scaffolding/renderEditor.template +++ b/src/templates/scaffolding/renderEditor.template @@ -1,7 +1,8 @@ <% - if (pluginManager?.hasGrailsPlugin('hibernate')) { - cp = domainClass.constrainedProperties[property.name] - } + if (pluginManager?.hasGrailsPlugin('hibernate4') || pluginManager?.hasGrailsPlugin('hibernate3')) { + cp = domainClass.constrainedProperties[property.name] + } + def name = prefix ? "${prefix}${property.name}" : property.name switch (property.type) {