diff app/controllers/news_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/news_controller.rb	Wed Jun 27 14:56:14 2012 +0100
+++ b/app/controllers/news_controller.rb	Wed Jun 27 15:04:58 2012 +0100
@@ -67,8 +67,8 @@
 
   def create
     @news = News.new(:project => @project, :author => User.current)
+    @news.safe_attributes = params[:news]
     if request.post?
-      @news.attributes = params[:news]
       if @news.save
         flash[:notice] = l(:notice_successful_create)
         redirect_to :controller => 'news', :action => 'index', :project_id => @project
@@ -82,7 +82,8 @@
   end
 
   def update
-    if request.put? and @news.update_attributes(params[:news])
+    @news.safe_attributes = params[:news]
+    if request.put? and @news.save
       flash[:notice] = l(:notice_successful_update)
       redirect_to :action => 'show', :id => @news
     else