Created
April 29, 2010 15:07
-
-
Save dcrec1/383737 to your computer and use it in GitHub Desktop.
State of Brazil for Spree
This file contains 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
states = <<STATES | |
28,AC,Acre | |
28,AL,Alagoas | |
28,AP,Amapá | |
28,AM,Amazonas | |
28,BA,Bahia | |
28,CE,Ceará | |
28,ES,Espírito Santo | |
28,GO,Goiás | |
28,MA,Maranhão | |
28,MT,Mato Grosso | |
28,MS,Mato Grosso do Sul | |
28,MG,Minas Gerais | |
28,PA,Pará | |
28,PB,Paraíba | |
28,PR,Paraná | |
28,PE,Pernambuco | |
28,PI,Piauí | |
28,RJ,Rio de Janeiro | |
28,RN,Rio Grande do Norte | |
28,RS,Rio Grande do Sul | |
28,RO,Rondônia | |
28,RR,Roraima | |
28,SC,Santa Catarina | |
28,SP,São Paulo | |
28,SE,Sergipe | |
28,TO,Tocantins | |
28,DF,Distrito Federal | |
STATES | |
State.transaction do | |
states.each do |state| | |
values = state.split ',' | |
State.create! :country_id => values[0], :abbr => values[1], :name => values[2].sub("\n", "") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment