Created
July 10, 2010 23:16
-
-
Save rrrene/471122 to your computer and use it in GitHub Desktop.
All Models in rails (that are already loaded)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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