I have a Rails v 2.0.2 application. I'd like to initialize a constant in initializers/constants.rb and set its value from DB.
smth like this:
SESSION_DURATION = SystemDB::Configuration.get('session_duration', 0).to_i.minutes
So i've got a Configuration table in PostgreSQL with row where name = 'session_duration'. This code works fine on my local Windows PC but it fails on production server with Linux with error: `retrieve_connection': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)
It seems to me that at the time rails initializes the constants.rb file ActiveRecord has not been initialized yet. What can i do with it?
By The Way. I use this constant in module - so it must me initialized as soon as possible. (if i understand well)