- Clean up the seed file for cities in China
- Ensure all priority values have a consistent formatting style
This change enhances the readability of the data seeding code without altering the underlying logic or functionality of the application.
- Introduced constants for configuration settings such as generation interval, maximum duration, and sleep duration.
- Updated the `perform` method to utilize these constants for better readability and maintainability.
- Refactored the `perform` method in `GenerateWeatherArtWorker` to improve flow and error handling by creating separate methods for fetching weather data, generating prompts, images, and handling database transactions.
- Cleaned up city seeding data by removing unnecessary fields while maintaining required functionality.
These changes improve the overall readability of the code and make it easier to adjust the behavior of the workers in the future without digging through the logic.
- Changed 'last_weather_fetch' and 'last_image_generation'
from 10.hours.ago to 10.days.ago for various cities
- Affects seed data for cities in multiple countries, including:
- Australia
- Bangladesh
- Brazil
- Canada
- China
- Egypt
- France
- Germany
- India
- Japan
- Mexico
- Nigeria
- Pakistan
- Russia
- Saudi Arabia
- Singapore
- South Korea
- Thailand
- Turkey
- UK
- USA
- Vietnam
This change ensures that the timestamps reflect a more refined time range for when last weather data was fetched, possibly to enhance performance or consistency in application behavior.
- Update active status of various cities from false to true
- Ensures that all seeded cities are now enabled and available for usage
This change activates previously inactive cities in the seed files, which
facilitates their accessibility in subsequent deployments and testing.
The modification was made across numerous city seed files to ensure a
consistent state where all cities are now marked as active, improving
the readiness of the application.
- Created BatchGenerateWeatherArtsJob to process eligible
cities and generate weather art.
- Introduced GenerateWeatherArtJob for generating weather
art and image attachment.
- Added AiService for obtaining prompts and generating
images with OpenAI API.
- Implemented WeatherService to fetch current weather
data from the QWeather API.
- Updated Gemfile with necessary gems (whenever,
ruby-openai, httparty, down, aws-sdk-s3).
This commit introduces a system to create and store
weather art images for various cities based on current
weather conditions, leveraging external APIs for data
and image generation.
- 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.
- Implement Country and Region models
- Establish relationships between City, Country, and Region
- Update ActiveAdmin setup for managing countries and regions
- Add localization support for cities and countries in multiple languages
- Create necessary migrations to support the new schema
This update allows for better categorization of cities under their respective countries and regions, enhancing geographical structure and support for multilingual features.