Is there a way to do what theConfig.groovy file does, but during the code execution…
Something like:
class AController{
def method(){
withEnvironments{
development{
println 'This is execute just on development'
}
production {
log.debug 'This is execute just on production'
}
}
}
}
I know that I can achieve the same effect using if (Environment.current == 'development'), but is there something with that sintax???
Found this blog post which shows one possible solution using
Environment.executeForCurrentEnvironment: