Created
September 21, 2013 19:10
-
-
Save perlmunger/6653288 to your computer and use it in GitHub Desktop.
Add all of the US states to a Rails model from the console with one line
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
# Here's what it looks like over multiple lines. Use the single line | |
# one below in the console or it won't work. | |
# ["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL", | |
# "IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT", | |
# "NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI", | |
# "SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY","AS","DC", | |
# "FM","GU","MH","MP","PW","PR","VI", | |
# "AE","AA","AE","AE","AE","AP"].each { |st| group = Group.new( :name => st); group.save } | |
["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY","AS","DC","FM","GU","MH","MP","PW","PR","VI","AE","AA","AE","AE","AE","AP"].each { |st| group = Group.new( :name => st); group.save } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment