You can’t use class variables in rails.

You can’t use class variables in rails.  Unless you’d like to develop in production mode (specifically with config.cache_classes = true).  In development mode all classes are reloaded on each request, which clears all class variables.

I had the perfect place to use them – while running a mass synchronization, and needing to store the timestamp (I couldn’t use the latest last_updated from each record).  It worked perfect in ./script/console but failed entirely through the browser.

. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>