hackclub / hackclub/hcb

[`CountryEnumable`] Migrate to storing alpha2 and drop `country_enum_list`

Open
#8,386 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
870
Forks
138
Avg merge
1d 14h
Merged PRs (30d)
208

Description

At the moment, our `CountryEnumable` uses both the `countries` gem (`ISO3166::Country`) in addition to our own custom-defined hash located in [`CountryEnumable::country_enum_list`](https://github.com/hackclub/bank/blob/cd3adb8039c58e491c356bdef03f2b3dfaa7cef9/app/models/concerns/country_enumable.rb#L22)

The goal is to drop our custom-defined `CountryEnumable::country_enum_list` and solely depend on the `countries` gem for our list of countries. To make this happen, we need to migrate from storing a country as an integer to storing it as alpha2.

Contributor guide

Open the contributing guide

Research direction

Start with app/models/concerns/country_enumable.rb and inspect closed pull request #9499 for prior context. Trace how CountryEnumable values are persisted and consumed, then verify that the custom country_enum_list is no longer needed and countries are stored using alpha2 values.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend, databases
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.