delete recordings with account

This commit is contained in:
Joshua Arts 2018-07-27 14:14:48 -04:00
parent 5e5f31c375
commit 7b15b84daa
6 changed files with 15 additions and 7 deletions

View File

@ -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)

View File

@ -1,4 +1,4 @@
<div class="container mt-8">
<div class="container pt-8">
<%= render "shared/components/subtitle", subtitle: t("settings.title"), search: false %>
<div class="row">

View File

@ -1,5 +1,5 @@
<div class="container">
<div class="row mt-6">
<div class="row pt-7">
<div class="col col-4 offset-4">
<div class="card">
<div class="card-header background">

View File

@ -1,4 +1,4 @@
<div class="container mt-5">
<div class="container pt-5">
<div class="col-md-8 offset-2">
<div class="card">
<div class="card-header">
@ -8,7 +8,7 @@
<div class="terms">
<p><%= Rails.configuration.terms %></p>
</div>
<div class="btn-list mt-4 text-right mt-8">
<div class="btn-list text-right pt-8">
<%= button_to t("terms.accept"), terms_path, params: {accept: true}, class: "btn btn-primary btn-space" %>
</div>
</form>

View File

@ -2,7 +2,7 @@
# Load terms and conditions.
terms = "#{Rails.root}/config/terms.txt"
terms = "#{Rails.root}/config/terms.md"
Rails.configuration.terms = if File.exist?(terms)
File.read(terms)

View File

@ -111,10 +111,10 @@ en:
image: Image
image_url: Profile Image URL
subtitle: Update your Account Info
title: Account
title: Account Info
delete:
button: Yes, I would like to delete my account.
disclaimer: If you choose to delete your account, it will <b>NOT</b> be recoverable. All information regarding your account, including settings, rooms, and recording references will be removed.
disclaimer: If you choose to delete your account, it will <b>NOT</b> be recoverable. All information regarding your account, including settings, rooms, and recording will be removed.
subtitle: Permanently Delete your Account
title: Delete Account
design: