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.
This pull request introduces the
friendly_id
gem to replace numeric IDs with human-readable slugs for URLs. This involves changes across models, controllers, serializers, and database migrations. The most important changes include adding thefriendly_id
gem, updating models to use slugs, and modifying controllers and serializers to support the new slugs.Integration of
friendly_id
gem:friendly_id
gem toGemfile
.friendly_id
with global configuration. (config/initializers/friendly_id.rb
)Model updates:
City
,Company
,Continent
,Country
, andRegion
models to usefriendly_id
for generating slugs and ensuring slug presence validation. (app/models/city.rb
,app/models/company.rb
,app/models/continent.rb
,app/models/country.rb
,app/models/region.rb
) [1] [2] [3] [4] [5]Controller and serializer updates:
CompaniesController
to use slugs instead of numeric IDs. (app/controllers/companies_controller.rb
)CompanySerializer
andGeoFragmentSerializer
to include slugs. (app/serializers/company_serializer.rb
,app/serializers/geo_fragment_serializer.rb
) [1] [2]Frontend updates:
app/frontend/pages/companies/index.tsx
,app/frontend/types/company.ts
,app/frontend/types/geo_fragment.ts
) [1] [2] [3]Database migrations:
db/migrate/20240918173013_create_friendly_id_slugs.rb
,db/migrate/20240918173030_add_slug_to_companies.rb
,db/migrate/20240918180412_add_slug_to_continents.rb
,db/migrate/20240918181314_add_slug_to_countries.rb
,db/migrate/20240918181525_add_slug_to_region.rb
,db/migrate/20240918181921_add_slug_to_city.rb
) [1] [2] [3] [4] [5] [6]