Skip to content

Instantly share code, notes, and snippets.

@guilpejon
Last active October 31, 2016 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guilpejon/31bb921f237159972fba to your computer and use it in GitHub Desktop.
Save guilpejon/31bb921f237159972fba to your computer and use it in GitHub Desktop.
Create Brazil states in spree
brazil = Spree::Country.find_by(name: "Brasil")
Spree::State.create!(
[{name: "Acre", abbr: "AC", country: brazil},
{name: "Alagoas", abbr: "AL", country: brazil},
{name: "Amapá", abbr: "AP", country: brazil},
{name: "Amazonas", abbr: "AM", country: brazil},
{name: "Bahia", abbr: "BA", country: brazil},
{name: "Ceará", abbr: "CE", country: brazil},
{name: "Espírito Santo", abbr: "ES", country: brazil},
{name: "Goiás", abbr: "GO", country: brazil},
{name: "Maranhão", abbr: "MA", country: brazil},
{name: "Mato Grosso", abbr: "MT", country: brazil},
{name: "Mato Grosso do Sul", abbr: "MS", country: brazil},
{name: "Minas Gerais", abbr: "MG", country: brazil},
{name: "Pará", abbr: "PA", country: brazil},
{name: "Paraíba", abbr: "PB", country: brazil},
{name: "Paraná", abbr: "PR", country: brazil},
{name: "Pernambuco", abbr: "PE", country: brazil},
{name: "Piauí", abbr: "PI", country: brazil},
{name: "Rio de Janeiro", abbr: "RJ", country: brazil},
{name: "Rio Grande do Norte", abbr: "RN", country: brazil},
{name: "Rio Grande do Sul", abbr: "RS", country: brazil},
{name: "Rondônia", abbr: "RO", country: brazil},
{name: "Roraima", abbr: "RR", country: brazil},
{name: "Santa Catarina", abbr: "SC", country: brazil},
{name: "São Paulo", abbr: "SP", country: brazil},
{name: "Sergipe", abbr: "SE", country: brazil},
{name: "Tocantins", abbr: "TO", country: brazil},
{name: "Distrito Federal", abbr: "DF", country: brazil}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment