Created
May 19, 2015 07:40
-
-
Save psahni/fa6cf6ef41102c8ddc95 to your computer and use it in GitHub Desktop.
Active record hacks
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
# GET COLUMN NAMES AND THEIR TYPE | |
ActiveRecord::Base.connection.columns(table_name).each {|c| puts "- " + c.name + ": " + c.type.to_s + " " + c.limit.to_s} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment