Skip to content

Instantly share code, notes, and snippets.

@jqr
Created April 8, 2009 03:00
Show Gist options
  • Save jqr/91605 to your computer and use it in GitHub Desktop.
Save jqr/91605 to your computer and use it in GitHub Desktop.
# Preloads models in a subdirectory of RAILS_ROOT/app/models so STI can find
# them properly.
Dir.glob(File.join(RAILS_ROOT, 'app', 'models', '**/*.rb')) do |file|
require file
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment