When putting your configuration in the Config.groovy
file, you have two options:
Option 1:
some {
application {
config = "3"
}
}
Option 2:
some.application.config = "foo"
Both of these allow you to do the following to retrieve the configuration value:
grailsApplication.config.some.application.config
grailsApplication.config."some.application.config"
If you add (override) the key to the application config like so:
grailsApplication.config.add("some.application.config", "bar")
Then retrieving the configuration without quotes will give you the original value, while retrieving it with quotes will give you the new value:
grailsApplication.config.some.application.config // => "foo"
grailsApplication.config."some.application.config" // => "bar"
It would be nice if there was a way to override the non-quoted way, without having to generate a map and add the map. I've implemented this, but it introduces even more strange issues.
For now the only option is to only retrieve configuration values using one of the following formats:
grailsApplication.config."some.application.config"
grailsApplication.config.get("some.application.config")