Created
March 22, 2013 08:42
-
-
Save tagrudev/5219811 to your computer and use it in GitHub Desktop.
get all models Rails
This file contains hidden or 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
Module.constants.select do |constant_name| | |
constant = eval constant_name | |
if not constant.nil? and constant.is_a? Class and constant.superclass == ActiveRecord::Base | |
constant | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment