Skip to content

Instantly share code, notes, and snippets.

Created June 16, 2010 01:20
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
#in development.rb - this avoids the missing constant error which can result on a 2nd and subsequent request
#it can also fix the timezone aware problem expressed at
#we use this to ensure that the dev environment (with config.cache_classes=false) remembers to load certain classes
#this isn't an issue in production where config.cache_classes=true
class ClassLoader
def initialize(app)
@app = app
def call(env)
load 'folder_entry.rb' unless defined? FolderEntry
load 'cms.rb' unless defined? Cms
load 'folder.rb' unless defined? Folder
load 'cms_page.rb' unless defined? CmsPage
load 'article.rb' unless defined? Article
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment