Skip to content

Commit

Permalink
Merge pull request #2022 from DFE-Digital/fix/require-openstruct-glob…
Browse files Browse the repository at this point in the history
…ally

Play past OpenStruct loading issue with global 'require'
  • Loading branch information
edavey authored Dec 5, 2024
2 parents 23e9c83 + 1aadf13 commit 8bfba67
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
4 changes: 0 additions & 4 deletions app/models/concerns/teamable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,5 @@ module Teamable
def regional_teams
REGIONAL_TEAMS.values
end

def user_teams
USER_TEAMS.values
end
end
end
3 changes: 1 addition & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ def add_new_project
end

def team_options
team_struct = Struct.new(:id, :name)
User.user_teams.map { |team| team_struct.new(team, I18n.t("user.teams.#{team}")) }
User.teams.keys.map { |team| OpenStruct.new(id: team, name: I18n.t("user.teams.#{team}")) }
end

private def apply_roles_based_on_team
Expand Down
2 changes: 2 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require_relative "boot"

require "ostruct"

require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
Expand Down

0 comments on commit 8bfba67

Please sign in to comment.