diff options
Diffstat (limited to 'app/controllers/documents_controller.rb')
-rw-r--r-- | app/controllers/documents_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index 43cfc2530..47065f934 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -27,7 +27,7 @@ class DocumentsController < ApplicationController def index @sort_by = %w(category date title author).include?(params[:sort_by]) ? params[:sort_by] : 'category' - documents = @project.documents.includes(:attachments, :category).all + documents = @project.documents.includes(:attachments, :category).to_a case @sort_by when 'date' @grouped = documents.group_by {|d| d.updated_on.to_date } @@ -43,7 +43,7 @@ class DocumentsController < ApplicationController end def show - @attachments = @document.attachments.all + @attachments = @document.attachments.to_a end def new @@ -69,7 +69,7 @@ class DocumentsController < ApplicationController def update @document.safe_attributes = params[:document] - if request.put? and @document.save + if @document.save flash[:notice] = l(:notice_successful_update) redirect_to document_path(@document) else |