Fix bug that caused room edit to clear settings (#2649)

This commit is contained in:
Ahmad Farhat 2021-04-12 19:31:02 -04:00 committed by GitHub
parent 7845d35d29
commit 2359d1256f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 5 deletions

View File

@ -203,12 +203,17 @@ class RoomsController < ApplicationController
# Update the rooms values # Update the rooms values
room_settings_string = create_room_settings_string(options) room_settings_string = create_room_settings_string(options)
@room.update_attributes( attributes = {
name: options[:name], name: options[:name],
room_settings: room_settings_string, }
access_code: options[:access_code],
moderator_access_code: options[:moderator_access_code] unless params[:setting] == "rename_header"
) attributes[:room_settings] = room_settings_string
attributes[:access_code] = options[:access_code]
attributes[:moderator_access_code] = options[:moderator_access_code]
end
@room.update(attributes)
flash[:success] = I18n.t("room.update_settings_success") flash[:success] = I18n.t("room.update_settings_success")
rescue => e rescue => e