how to make ormsetting based on the environment

Hi All,

I would like to modify my ormsetting dbcreate based on the environment. I am just wondering where I should do that?


The only way I’ve found to get those settings to stick properly is to have a getORMSettings() method in my Application CFC which has the ORM conditionals for development, staging, and production.

Then in Application.cfc I just have:

this.ormSettings = getORMSettings();

If there’s a CF-ninja way to do this at runtime, I’d love to know. I just haven’t been able to reliably change the ORM settings outside of App.cfc.


Hi Jon,

So in your getORMSettings() have a way to detect the environment isn’t it. Is it going to be a double code which is in the Application.cfc and in the Coldbox.cfc or just one code base to detect the environment. Could you please let me know how do you do to detect the environment in the Application.cfc?

Thank You.