Reputation: 1707
I am working on a multi-tenant architecture based plugin, where I am adding a tenantId
variable on few domain classes. Now this variable gets assigned its value automatically at object creation time via some code in Domain class itself and the User need not assign it manually.
Now the problem is that I need to provide this functionality to other developers and who actually generate the GSP views using grails generate-views com.something.someClass
.
By doing this the generated view also has field for selection of tenant
. So is there any domain class constraint or any setting that I can apply to prevent this variable from being automatically included in the view?
P.S. - Any such setting will be anytime better than manual removal of field from view each time.
Thanks.
Upvotes: 2
Views: 131
Reputation: 7619
Try follow steps:
1- run this command to copies the the templates used by Grails during code generation
grails install-templates
2- then open _form
file (found in src/templates/scaffolding
folder)
3- add tenantId
in excludedProps
variable like grails did with version
field
excludedProps = Event.allEvents.toList() << 'version' << ... << 'tenantId'
Note- I haven't tried this.
Upvotes: 1