diff app/controllers/documents_controller.rb @ 931:ec1c49528f36 cannam_integration

Merge from branch "redmine-1.3"
author Chris Cannam
date Wed, 27 Jun 2012 15:04:58 +0100
parents 5f33065ddc4b
children 433d4f72a19b
line wrap: on
line diff
--- a/app/controllers/documents_controller.rb	Wed Jun 27 14:56:14 2012 +0100
+++ b/app/controllers/documents_controller.rb	Wed Jun 27 15:04:58 2012 +0100
@@ -47,7 +47,8 @@
   end
 
   def new
-    @document = @project.documents.build(params[:document])
+    @document = @project.documents.build
+    @document.safe_attributes = params[:document]
     if request.post? and @document.save	
       attachments = Attachment.attach_files(@document, params[:attachments])
       render_attachment_warning_if_needed(@document)
@@ -58,7 +59,8 @@
 
   def edit
     @categories = DocumentCategory.active #TODO: use it in the views
-    if request.post? and @document.update_attributes(params[:document])
+    @document.safe_attributes = params[:document]
+    if request.post? and @document.save
       flash[:notice] = l(:notice_successful_update)
       redirect_to :action => 'show', :id => @document
     end