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

Play past OpenStruct loading issue with global 'require' #2022

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading