Commit Graph

9 Commits

Author SHA1 Message Date
2d81dd91e7 feat: activate cities in seed files
- 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.
2025-01-22 17:00:27 +08:00
d728d7f50e feat: add batch weather art generation jobs
- 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.
2025-01-22 16:50:00 +08:00
9cb1467301 feat: enhance weather arts and cities features
- Add slug column to weather_arts for friendly URLs.
- Update weather arts retrieval in the controller to use slug.
- Implement region and country filtering in cities index view.
- Optimize city queries with scopes for active status and region/country.
- Improve UI layout and design for the cities index page.

These changes allow better user experience by enabling cleaner URLs for weather arts and facilitating efficient filtering of cities based on selected regions and countries.
2025-01-22 14:04:58 +08:00
c11d10c86a feat: update city display and database schema
- 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.
2025-01-21 21:29:26 +08:00
ebaf7a3f34 feat: add countries and regions management
- 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.
2025-01-21 18:27:26 +08:00
34c05232ee chore: clean up code style and unused fixtures
- Standardize string quotes in various files for consistency.
- Remove commented-out tests from cities and weather_arts controllers to improve readability.
- Clean up admin_users and weather_arts fixture files by commenting out unused entries instead of removing them.

These changes are aimed at enhancing code readability and maintainability, ensuring that code adheres to style guidelines without removing useful comments for future reference.
2025-01-20 18:08:55 +08:00
a533390356 feat: add weather art records for Guangzhou
- Update weather date for existing record to 5 days ago
- Add new weather art record for 2 days ago with relevant details
- Include image attachment for the new weather art

This commit adds a second weather art record for Guangzhou reflecting the
weather conditions from 2 days ago, along with relevant data including
humidity, wind speed, and an updated visual representation.
2025-01-20 17:37:24 +08:00
e5743a5e3f feat: add friendly_id for cities and weather arts
- Integrate 'friendly_id' gem for sluggable functionality in City model
- Create ActiveAdmin resources for managing cities and weather arts
- Implement controller logic for cities
- Add database migrations for cities and weather arts creation
- Seed database with sample data for testing
- Create initial test cases for controllers and models

This commit enhances the application's URL handling by allowing friendly URLs for cities and weather arts. The addition of ActiveAdmin resources facilitates easier management through a web interface.
2025-01-19 12:21:00 +08:00
8517905b68 init with rails8 + active-admin 2025-01-19 01:13:59 +08:00