diff --git a/app/models/room.rb b/app/models/room.rb index bc439f8a..4ae7b146 100644 --- a/app/models/room.rb +++ b/app/models/room.rb @@ -3,6 +3,8 @@ class Room < ApplicationRecord before_create :setup + before_destroy :delete_all_recordings + validates :name, presence: true belongs_to :owner, class_name: 'User', foreign_key: :user_id @@ -155,6 +157,12 @@ class Room < ApplicationRecord self.bbb_id = Digest::SHA1.hexdigest(Rails.application.secrets[:secret_key_base] + Time.now.to_i.to_s).to_s end + # Deletes all recordings associated with the room. + def delete_all_recordings + record_ids = recordings.map { |r| r[:recordID] } + delete_recording(record_ids) + end + # Generates a three character uid chunk. def uid_chunk charset = ("a".."z").to_a - %w(b i l o s) + ("2".."9").to_a - %w(5 8) diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 7e10bf8b..797d99b3 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,4 +1,4 @@ -
<%= Rails.configuration.terms %>