Skip to content

Commit

Permalink
LTI-386: Fix error of settings page not showing (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariam05 committed Jun 20, 2024
1 parent 4377647 commit 8658929
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/models/room.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class Room < ApplicationRecord
before_save :default_values

store_accessor :settings, [:lockSettingsDisableCam, :lockSettingsDisableMic, :lockSettingsDisablePrivateChat, :lockSettingsDisablePublicChat, :lockSettingsDisableNote]
store_accessor :settings, %i[lockSettingsDisableCam lockSettingsDisableMic lockSettingsDisablePrivateChat lockSettingsDisablePublicChat lockSettingsDisableNote]
store_accessor :settings, %i[waitForModerator allModerators guestPolicy record autoStartRecording allowStartStopRecording]

# after_find is used for the following so that rooms that already exist will have these fields upon launch
Expand All @@ -30,6 +30,7 @@ class Room < ApplicationRecord
include BrokerHelper

RECORDING_SETTINGS = [:record, :autoStartRecording, :allowStartStopRecording].freeze
ROOM_SETTINGS = [:guestPolicy, :allModerators, :waitForModerator].freeze
CODE_LENGTH = 10

def default_values
Expand Down
4 changes: 2 additions & 2 deletions app/views/rooms/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
<%= form.hidden_field :viewer, value: @room.viewer %>
<% @lockSettings = @room.settings.select { |key, value| key.start_with?("lock")} %>
<% @recordingSettings = @room.settings.select { |key, value| !key.start_with?("lock") && Room::RECORDING_SETTINGS.include?(key.to_sym)} %>
<% @roomSettings = @room.settings.select { |key, value| !key.start_with?("lock") && !Room::RECORDING_SETTINGS.include?(key.to_sym)} %>
<% @recordingSettings = @room.settings.select { |key, value| Room::RECORDING_SETTINGS.include?(key.to_sym)} %>
<% @roomSettings = @room.settings.select { |key, value| Room::ROOM_SETTINGS.include?(key.to_sym)} %>

<details>
<summary class="text-black"><%= t('default.room.settings.lockSettingsTitle') %>
Expand Down

0 comments on commit 8658929

Please sign in to comment.