Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow more than two Nationalities #621

Open
Robin481 opened this issue Mar 11, 2024 · 3 comments
Open

Allow more than two Nationalities #621

Robin481 opened this issue Mar 11, 2024 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers Idea Drop your idea

Comments

@Robin481
Copy link
Member

Robin481 commented Mar 11, 2024

Some people have asked for the ability to add more than two nationalities.

Modify the person form in such a way that any amount of nationalities can be entered.

Things to consider:
The current db model has nationality and nationality2. This will need to change if we want to have a dynamic amount of nationalities. After talking to Päscu I've decided to let the primary nationality be for now. The secondary will probably be replaced with something that can hold up more nationalities than one.

I have not decided what to replace nationality2 with yet but here are a few Ideas im going to talk about with Robin:

  • JSON or JSONB Column
  • Serialized array
  • Maybe just join the tables...?

Solution
We have decided that we want to keep the original nationality attribute so a person still only can have this as the primary one. The nationality2 attribute is beeing changed into a json, so it can hold up a various number of nationalities.

@Robin481 Robin481 added enhancement New feature or request good first issue Good for newcomers Idea Drop your idea labels Mar 11, 2024
@jschulthess
Copy link

jschulthess commented Mar 11, 2024

While you're at it, could you please add "Liberland" to the country list.

@Robin481
Copy link
Member Author

@jschulthess We are using ISO-3166 and won't be deviating from that standard.

@ManuelMoeri ManuelMoeri self-assigned this Jun 12, 2024
@ManuelMoeri ManuelMoeri removed their assignment Jun 17, 2024
@ManuelMoeri ManuelMoeri linked a pull request Jun 17, 2024 that will close this issue
@ManuelMoeri
Copy link
Collaborator

ManuelMoeri commented Jun 17, 2024

What has been done so far

  • A branch has been created and a pull request is linked aswell. The Pull request is already closed because robin does not like open pr's.
  • I've wrote a migration script for the nationality2 attribute on person. Is basically just parses it from a string to a json.
  • I have also commented out the validation for the nationality2 attribute, which is obviously not temporarily but a solution to not get spammed with errors for now.

That's everything. There have also been changes on the schema.rb since it's now a json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers Idea Drop your idea
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants