summaryrefslogtreecommitdiffstats
path: root/app/controllers/wiki_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-05-26 17:22:27 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-05-26 17:22:27 +0000
commitf12315075fc5780c68093610295ace7ae2c4ac78 (patch)
tree238b51dc311c42a169a35e8e37fd940c31e5ae19 /app/controllers/wiki_controller.rb
parentc99da154452d97e9ffed933e9645db60f66cdf52 (diff)
downloadredmine-f12315075fc5780c68093610295ace7ae2c4ac78.tar.gz
redmine-f12315075fc5780c68093610295ace7ae2c4ac78.zip
Optimistic locking added for wiki edits.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@545 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/wiki_controller.rb')
-rw-r--r--app/controllers/wiki_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb
index d8f23cfd1..f85c719bc 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -60,14 +60,18 @@ class WikiController < ApplicationController
redirect_to :action => 'index', :id => @project, :page => @page.title
return
end
- @content.text = params[:content][:text]
- @content.comments = params[:content][:comments]
+ #@content.text = params[:content][:text]
+ #@content.comments = params[:content][:comments]
+ @content.attributes = params[:content]
@content.author = logged_in_user
# if page is new @page.save will also save content, but not if page isn't a new record
if (@page.new_record? ? @page.save : @content.save)
redirect_to :action => 'index', :id => @project, :page => @page.title
end
end
+ rescue ActiveRecord::StaleObjectError
+ # Optimistic locking exception
+ flash[:notice] = l(:notice_locking_conflict)
end
# show page history