Draft
Conversation
8c7e7a9 to
06f9fe9
Compare
This was referenced Sep 30, 2024
1583197 to
f6ffa29
Compare
f6ffa29 to
358010f
Compare
There was a problem hiding this comment.
PR Overview
This PR introduces pluralization functionality for Rosetta by adding new operator classes, corresponding tests, and integrating pluralization rules into the model and schema.
- Added operator classes (LessThan, LessThanOrEqualTo, EqualTo, GreaterThan, GreaterThanOrEqualTo) with a common BaseOperator interface
- Introduced tests for each operator and updated the PluralizationRule model, migrations, and fixtures accordingly
Reviewed Changes
| File | Description |
|---|---|
| test/lib/rosetta/pluralization/operators/greater_than_or_equal_to.rb | New test for GreaterThanOrEqualTo operator |
| test/lib/rosetta/pluralization/operators/greater_than_test.rb | New test for GreaterThan operator |
| test/lib/rosetta/pluralization/operators/less_than_test.rb | New test for LessThan operator |
| test/lib/rosetta/pluralization/operators/less_than_or_equal_to_test.rb | New test for LessThanOrEqualTo operator |
| app/models/rosetta/pluralization_rule.rb | Updated model with operator mapping and validation |
| lib/rosetta/pluralization/base_operator.rb | Introduced common operator interface |
| lib/rosetta/pluralization/operators/* | Implementations of each pluralization operator |
| lib/rosetta/pluralization.rb | Aggregates pluralization functionality |
| test/fixtures/rosetta/pluralization_rules.yml | Added fixture for pluralization rules |
| db/migrate/20240920134441_create_rosetta_pluralization_rules.rb | Migration to create pluralization_rules table |
| app/models/rosetta/locale.rb | Updated Locale model with pluralization_rules association |
| db/migrate/20240923100651_add_default_to_rosetta_locales.rb | Updated migration for default locale flag |
| lib/rosetta-rails.rb | Included pluralization module |
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
| @@ -1,4 +1,4 @@ | |||
| class AddDefaultToRosettaLocales < ActiveRecord::Migration[7.2] | |||
| class AddDefaultToRosettaLocales < ActiveRecord::Migration[6.1] | |||
There was a problem hiding this comment.
The migration version has been changed from 7.2 to 6.1, which may be inconsistent with the rest of the project. Please verify that this downgrade is intentional and aligns with the project's Rails version.
Suggested change
| class AddDefaultToRosettaLocales < ActiveRecord::Migration[6.1] | |
| class AddDefaultToRosettaLocales < ActiveRecord::Migration[7.2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5