Skip to content

Instantly share code, notes, and snippets.

@rrrene
Created July 10, 2010 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rrrene/471122 to your computer and use it in GitHub Desktop.
Save rrrene/471122 to your computer and use it in GitHub Desktop.
All Models in rails (that are already loaded)
# All Models in rails (that are already loaded)
Object.constants.map { |c|
c.constantize
}.select { |klass|
klass.is_a?(Class) && klass < ActiveRecord::Base
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment