From 39218dec9290a52d05e3236607bbb6d4b53c8ca2 Mon Sep 17 00:00:00 2001 From: Sudharsanaraj R Ajey Date: Thu, 26 Oct 2017 10:10:53 +0530 Subject: [PATCH] Minor changes --- app/controllers/files_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 22b3a5e..896345a 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -45,7 +45,7 @@ def destroy def exists @folder = Folder.find(params[:folder]) - if current_user.can_read @folder || current_user.can_write @folder + if current_user.can_read(@folder) || current_user.can_write(@folder) @file = @folder.user_files.build(:attachment_file_name => params[:name].gsub(RESTRICTED_CHARACTERS, '_')) render :json => !@file.valid? end