songtianlun
c11d10c86a
- Change city name display to localized name in both index and show views - Modify schema to use bigint for certain foreign keys - Correct country codes in seeds for accurate data representation These changes improve the handling of city names, ensuring they are displayed in the appropriate localized format and ensuring well-typed foreign key relationships in the schema.
27 lines
545 B
Ruby
27 lines
545 B
Ruby
germany = Country.find_by code: 'DE'
|
|
|
|
City.create!([
|
|
{
|
|
name: 'Frankfurt',
|
|
latitude: 50.1109,
|
|
longitude: 8.6821,
|
|
country: germany,
|
|
timezone: 'Europe/Berlin',
|
|
active: true,
|
|
priority: 100,
|
|
last_weather_fetch: 10.hours.ago,
|
|
last_image_generation: 10.hours.ago
|
|
},
|
|
{
|
|
name: 'Berlin',
|
|
latitude: 52.5200,
|
|
longitude: 13.4050,
|
|
country: germany,
|
|
timezone: 'Europe/Berlin',
|
|
active: true,
|
|
priority: 100,
|
|
last_weather_fetch: 10.hours.ago,
|
|
last_image_generation: 10.hours.ago
|
|
}
|
|
])
|