Skip to content

Instantly share code, notes, and snippets.

@qrush
Created November 26, 2008 06:58
Show Gist options
  • Select an option

  • Save qrush/29315 to your computer and use it in GitHub Desktop.

Select an option

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