Skip to content

Instantly share code, notes, and snippets.

@qrush
Created November 26, 2008 06:58
Show Gist options
  • Save qrush/29315 to your computer and use it in GitHub Desktop.
Save qrush/29315 to your computer and use it in GitHub Desktop.
# If you ever needed an array of all models in your Rails app (+ Session)
Dir.glob("app/models/*.rb").each{|r| require r}; subclasses_of(ActiveRecord::Base).map{|c| c.class_name}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment