Skip to content

Instantly share code, notes, and snippets.

@tagrudev
Created March 22, 2013 08:42
Show Gist options
  • Save tagrudev/5219811 to your computer and use it in GitHub Desktop.
Save tagrudev/5219811 to your computer and use it in GitHub Desktop.
get all models Rails
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