diff --git a/db/seeds.rb b/db/seeds.rb index d8c8ce2..25587fc 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -9,9 +9,10 @@ CSV.foreach country_states_filename, native_name.strip! english_name.strip! - next if CountryState.where(english_name: english_name).exists? - - CountryState.create! english_name: english_name, native_name: native_name + CountryState.where(english_name: english_name) + .first_or_create! do |new_country_state| + new_country_state.native_name = native_name + end end Rails.application.settings(:superuser).tap do |config|