Skip to content

Commit

Permalink
Migrate WCAT to roles
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljames-dj committed May 1, 2024
1 parent a3fe31a commit eba93c4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
4 changes: 0 additions & 4 deletions app/models/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ def self.banned
Team.c_find_by_friendly_id!('banned')
end

def self.wcat
Team.c_find_by_friendly_id!('wcat')
end

def self.wmt
Team.c_find_by_friendly_id!('wmt')
end
Expand Down
1 change: 1 addition & 0 deletions db/migrate/20240430101638_migrate_some_teams_to_groups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ def change
migrate_team_members_to_group(Team.c_find_by_friendly_id!('wat'), UserGroup.teams_committees_group_wat)
migrate_team_members_to_group(Team.c_find_by_friendly_id!('wsot'), UserGroup.teams_committees_group_wsot)
migrate_team_members_to_group(Team.c_find_by_friendly_id!('weat'), UserGroup.teams_committees_group_weat)
migrate_team_members_to_group(Team.c_find_by_friendly_id!('wcat'), UserGroup.teams_committees_group_wcat)
end
end
1 change: 0 additions & 1 deletion db/seeds/teams.seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
Team.create(friendly_id: 'wrc', email: "regulations@worldcubeassociation.org")
Team.create(friendly_id: 'wst', email: "software@worldcubeassociation.org")
Team.create(friendly_id: 'banned', email: "disciplinary@worldcubeassociation.org", hidden: true)
Team.create(friendly_id: 'wcat', email: "competitions@worldcubeassociation.org")
Team.create(friendly_id: 'wdpc', hidden: true)
Team.create(friendly_id: 'wac', email: "advisory@worldcubeassociation.org")
1 change: 1 addition & 0 deletions spec/factories/roles_metadata_teams_committees.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
factory :wsot_member_metadata, traits: [:member]
factory :wsot_leader_metadata, traits: [:leader]
factory :weat_member_metadata, traits: [:member]
factory :wcat_member_metadata, traits: [:member]
end
end
6 changes: 6 additions & 0 deletions spec/factories/user_roles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@
metadata { FactoryBot.create(:weat_member_metadata) }
end

trait :wcat_member do
group { UserGroup.teams_committees_group_wcat }
metadata { FactoryBot.create(:wcat_member_metadata) }
end

trait :board do
group_id { UserGroup.board_group.id }
end
Expand Down Expand Up @@ -169,6 +174,7 @@
factory :wsot_member_role, traits: [:wsot_member, :active]
factory :wsot_leader_role, traits: [:wsot_leader, :active]
factory :weat_member_role, traits: [:weat_member, :active]
factory :wcat_member_role, traits: [:wcat_member, :active]
factory :board_role, traits: [:board, :active]
end
end
2 changes: 1 addition & 1 deletion spec/factories/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@

trait :wcat_member do
after(:create) do |user, options|
FactoryBot.create(:team_member, team_id: Team.wcat.id, user_id: user.id, team_senior_member: options.team_senior_member, team_leader: options.team_leader)
FactoryBot.create(:wcat_member_role, user_id: user.id)
end
end

Expand Down

0 comments on commit eba93c4

Please sign in to comment.