I am using Rails 2.3.x. I would like a small part of the code to run if and only if the value of config.cache_classes true. By default, this is true for production and false for development.
How do I access the config.cache_classes value outside of my environment.rb, development.rb, and production.rb files? It is easy to say whether we are in production or development, Rails.env will give us the answer. But there is no guarantee that the developer did not set config.cache_classes = true in development.
Of course, I understand that you generally do not want to run separate code paths in development and production. In this particular case, we simply do not do some startup work; if we need to complete it later, we will do it, both in development and in production.
ruby-on-rails
ChrisInEdmonton Nov 30 '10 at 23:28 2010-11-30 23:28
source share