2013-09-25

Rails get all models

#first load all models

Rails.application.eager_load!

#okay…each now :)

ActiveRecord::Base.send(:subclasses).each do |model|
  puts model.name
end

沒有留言:

張貼留言