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

Migrate WCT China to roles #9241

Merged
merged 2 commits into from Apr 24, 2024

Conversation

danieljames-dj
Copy link
Member

No description provided.

@@ -98,7 +98,7 @@

trait :wct_china_member do
after(:create) do |user, options|
FactoryBot.create(:team_member, team_id: Team.wct_china.id, user_id: user.id, team_senior_member: options.team_senior_member, team_leader: options.team_leader)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're losing two important bits of information (senior member, team leader). For WCT China, this is probably okay because they don't have so strict structures, but what about future role migrations?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For WCT China, the status is supposed to be member in testcases used so it's fine. For future migration, I'm planning to use multiple traits like wrt_member, wrt_senior_member, etc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be worth to compare this with the WST Admin migration code and come up with one (or multiple helper) function(s) like "def migrate_team_to_roles" in lib somewhere

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I've moved this method to lib so can be reused for upcoming migrations.

@danieljames-dj danieljames-dj merged commit 65377f5 into thewca:main Apr 24, 2024
1 check passed
@danieljames-dj danieljames-dj deleted the migrate-wct-china-to-roles branch April 24, 2024 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants