Fix abilities definition and related specs

This commit is contained in:
Senén Rodero Rodríguez
2017-08-24 02:11:13 +02:00
parent 8e91bbe5b5
commit 0fbffdc73e
7 changed files with 13 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
class DocumentsController < ApplicationController
before_action :authenticate_user!
before_filter :find_documentable, except: [:destroy]
before_filter :prepare_new_document, only: :new
before_filter :prepare_new_document, only: [:new, :new_nested]
before_filter :prepare_document_for_creation, only: :create
load_and_authorize_resource :except => [:upload]
@@ -10,6 +10,9 @@ class DocumentsController < ApplicationController
def new
end
def new_nested
end
def create
recover_attachment_from_cache
if @document.save