Merge branch 'master' into tailwind-redesign

This commit is contained in:
drusepth 2023-01-10 16:00:30 -08:00
commit 7676742058
4 changed files with 7 additions and 2 deletions

View File

@ -17,7 +17,8 @@ class FoldersController < ApplicationController
def destroy
# Relocate all documents in this folder to the root "folder"
Document.where(folder_id: @folder.id).update_all(folder_id: nil)
# TODO - I think we can handle this at the model association level with dependent: nullify, but I've never used it
Document.with_deleted.where(folder_id: @folder.id).update_all(folder_id: nil)
# Relocate all child folders in this folder to the root "folder"
Folder.where(parent_folder_id: @folder.id).update_all(parent_folder_id: nil)

View File

@ -2,7 +2,7 @@ class PageCollectionSubmissionsController < ApplicationController
before_action :set_page_collection, only: [:index]
before_action :set_page_collection_submission, only: [:show, :edit, :update, :destroy, :approve, :pass]
before_action :require_collection_ownership, only: [:index, :edit, :update, :destroy, :pass, :approve]
before_action :require_collection_ownership, only: [:index]
# GET /page_collection_submissions
def index

View File

@ -1,4 +1,6 @@
class ShareCommentsController < ApplicationController
before_action :authenticate_user!
before_action :set_share_comment, only: [:update, :destroy]
# POST /share_comments

View File

@ -1,4 +1,6 @@
class Folder < ApplicationRecord
has_many :documents
belongs_to :parent_folder, optional: true, class_name: Folder.name, foreign_key: :parent_folder_id
belongs_to :user