Skip to content

Commit

Permalink
Revert "(Fix) Replace OpenStruct with a plain Struct to solve loading…
Browse files Browse the repository at this point in the history
… issue"

This reverts commit 5f3b67d.

This is now fixed generally by requiring OpenStruct in the main
`application.rb` file:

```
require "ostruct"
```
  • Loading branch information
edavey committed Dec 5, 2024
1 parent 6b0c879 commit 1aadf13
Show file tree
Hide file tree
Showing 2 changed files with 1 addition 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

0 comments on commit 1aadf13

Please sign in to comment.