Skip to content

Instantly share code, notes, and snippets.

@ascendbruce
Created July 26, 2014 14:06
Show Gist options
  • Save ascendbruce/c40dfe79e985871281ee to your computer and use it in GitHub Desktop.
Save ascendbruce/c40dfe79e985871281ee to your computer and use it in GitHub Desktop.
# source: http://jokercatz.blogspot.tw/2013/09/rails-get-all-models.html
#first load all models
Rails.application.eager_load!
#okay…each now :)
ActiveRecord::Base.send(:subclasses).each do |model|
puts model.name
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment