I have the following simplified model in Grails:
- A
DataBlock
consists of a number of sortedConfigPreset
objects.
In ConfigPreset I have
static belongsTo = [dataBlock: DataBlock]
and the DataBlock class contains:
List presets
static hasMany = [presets: ConfigPreset]
DataBlock() {
addToPresets(new ConfigPreset())
}
The overloaded constructor returns: No signature of method: [...].addToPresets() is applicable for argument types: (ConfigPreset) values: [ConfigPreset : null].
But why is my ConfigPreset instance null? If I try to create a DataBlock object in e.g. BootStrap.groovy with an unmodified ctor and call addToPresets(...) on it, it works.