- Introduce a Redis-based lock to prevent concurrent execution of
batch generation tasks.
- Set a TTL of 300 seconds for the lock to ensure it is released
after a timeout.
- Add logging for situations where a task is already in progress.
This enhancement ensures that batch tasks do not overlap, which can
lead to data inconsistencies and resource contention. The locking
mechanism improves the reliability of the batch processing system.
- Introduced `TranslatableName` module to allow for
localized names for `Country` and `Region` models.
- Updated views to display `localized_name` instead of
`name` for improved internationalization.
- Refactored JSON serialization for `translations` attribute.
- Enhanced localization support by adding new languages:
Japanese and Korean, with updated locale files.
- Removed outdated English and Chinese locales for countries
and regions to clean up the codebase.
- Include assignment of country code when creating a city
- Ensure that all relevant geographical data is accounted for during
the city creation process
This change addresses a missing assignment of the country code for new
city records, ensuring that instances are complete and accurate.
- Integrate Devise for user authentication
- Create User model and necessary views
- Implement email confirmation and password reset functionality
- Add routing for user sign-up and login
- Customize error messages display
This commit initiates user authentication in the application
using the Devise gem. It includes user registration, login,
password reset, and email confirmation features. Additionally,
the necessary views and mailer templates are included to
support these functionalities. This enhances the security
and usability of the application by allowing users to create
accounts and manage their passwords effectively.
- Include 'devise' gem for user management
- Update database access URLs in configurations
- Refactor schema types from bigint to integer for resource and author IDs
- Enhance geo synchronization by updating region and subregion handling
These changes are aimed at improving the user management functionality while ensuring efficient data handling and connections for production environment.
- Replace verbose conditional checks with a ternary operator
- Use 'find_by!' for better error handling if country not found
- Maintain the functionality of state creation associated with the country
- Replace country name lookup with country code lookup
- Replace state name lookup with state code lookup
- Change city creation to ensure country association
This update modifies the existing logic for synchronizing city data to
use country and state codes instead of names. This aids in ensuring
more robust data integrity by relying on unique identifiers.
- Remove unnecessary debug output for country syncing.
- Improve country determination logic by adding checks for
both country code and country name.
- Ensure state records are associated with the correct
country ID post-refactor.
These changes enhance the clarity and efficiency
of the geo data synchronization code, making it easier to
maintain and reducing the risk of errors during data
syncing.
- Change output to include country name during state syncing
- Update record creation from `find_or_initialize_by!` to `find_or_create_by!`
This fix ensures that when syncing state data, the output provides
better context by showing the associated country name, and it also
ensures that states are created if they do not already exist, thus
eliminating potential issues with duplicate state entries.
- Refactor the country creation process to use a block for setting
the name attribute.
- Ensure that the name is set explicitly when a new country is
created with the appropriate ISO code.
This change optimizes the way country records are created and
ensures the name is always correctly assigned during the
creation process.
- Replace `find_or_create_by` and `find_or_initialize_by` with `find_or_create_by!` and `find_or_initialize_by!` for better error handling.
- Use the `update!` method instead of `update` to raise exceptions on failure.
- These changes improve the reliability of geographic data synchronization by ensuring failures are not silently ignored and facilitate easier troubleshooting.
- Change from find_or_initialize_by to find_or_create_by for
regions.
- Set region code to the name instead of nil.
This refactor reduces complexity in how regions are created and
ensures the code attribute is properly populated with the
region's name, enhancing data consistency.
- Update region name with data from the input
- Set code to nil to reset any previous values
- Preserve other attributes like translations, flag, and wiki_data_id
This change ensures that region data is updated correctly with the
provided input while eliminating any previous code settings that may
no longer be relevant.
- Change the method of finding or initializing subregions to use
the name attribute instead of the id.
- This improves accuracy when synchronizing subregion data, as it
ensures that subregions are correctly matched by name.
- Eliminates potential issues with duplicate IDs if they happen
to be reused across different data sources.
- Update the region lookup to use `name` instead of `id`
- This change allows for more flexible region identification
- Improves alignment with potential data structure changes
- Change method from find_or_create_by to find and check for nil
- Initialize a new Country object only if none exists
This fix addresses the potential issue where a country
is being unnecessarily created instead of found, improving
the efficiency of the country data synchronization process.
This change also adds clarity to the method's intent by
clearly separating the find and the initialization logic.
- Downgraded `aws-sdk-s3` to version 1.170 and updated
`aws-sdk-core` to 3.211 to maintain compatibility with
existing code.
- Updated various column types in the database schema
from `integer` to `bigint` to handle larger values and
improve data integrity.
- Modified the `sync_geo_data.rake` task to use
`find_or_create_by` for `Country`, improving the logic
for ensuring unique countries based on ISO code.
These changes enhance dependency management and improve
schema robustness while maintaining functionality.