/ Published in: Ruby
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
countries = Country.find(:all) for country in countries begin tzc = TZInfo::Country.get(country.code.upcase) rescue puts "can't find TZInfo for #{country.code.upcase}" next end puts tzc.name for zone in tzc.zone_names puts country.code.upcase puts zone CountryTimeZone.create(:parent_id => country.id, :name => zone) end end