Skip to content

Instantly share code, notes, and snippets.

View lucivaldo's full-sized avatar
🏠
Working from home

Lucivaldo lucivaldo

🏠
Working from home
View GitHub Profile
@lucivaldo
lucivaldo / my_app.rake
Created April 27, 2016 14:52
Rake task for display all models of the application
namespace :my_app do
desc "Display all models"
task models: :environment do |t|
puts 'Tabelas existentes:', ""
ActiveRecord::Base.connection.tables.delete_if do |table|
table.include? 'schema'
end.each do |table|
puts "<<<< #{table} >>>>"
ActiveRecord::Base.connection.columns(table).each do |column|