Created
February 5, 2015 13:54
-
-
Save barroso/ea7e6626678d1de6edc7 to your computer and use it in GitHub Desktop.
create VO by db
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
ActiveRecord::Base.connection.tables.each do |table_name| | |
puts "\nclass #{table_name.camelize} < VO" | |
ActiveRecord::Base.connection.columns(table_name).each {|c| puts " attribute :#{c.name}, #{c.type.to_s}"} | |
puts "end" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment