aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/comment_controller.rb7
-rw-r--r--app/models/info_request.rb4
2 files changed, 6 insertions, 5 deletions
diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb
index d852ffe17..7192eb84b 100644
--- a/app/controllers/comment_controller.rb
+++ b/app/controllers/comment_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: comment_controller.rb,v 1.1 2008-08-13 01:39:41 francis Exp $
+# $Id: comment_controller.rb,v 1.2 2008-08-26 16:03:36 francis Exp $
class CommentController < ApplicationController
@@ -15,7 +15,6 @@ class CommentController < ApplicationController
:comment_type => 'request',
:user => @user
}))
-
else
raise "Unknown type " + params[:type]
end
@@ -40,11 +39,11 @@ class CommentController < ApplicationController
:email => "Then your annotation to " + @info_request.title + " will be posted.",
:email_subject => "Confirm your annotation to " + @info_request.title
)
- @info_request.add_comment(params[:comment][:body], authenticated_user)
+ @comment = @info_request.add_comment(params[:comment][:body], authenticated_user)
# This automatically saves dependent objects in the same transaction
@info_request.save!
flash[:notice] = "Thank you for making an annotation!"
- redirect_to request_url(@info_request)
+ redirect_to comment_url(@comment)
else
# do nothing - as "authenticated?" has done the redirect to signin page for us
end
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index af1d8b38a..8e303eed2 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -23,7 +23,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: info_request.rb,v 1.130 2008-08-21 00:41:44 francis Exp $
+# $Id: info_request.rb,v 1.131 2008-08-26 16:03:36 francis Exp $
require 'digest/sha1'
require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian')
@@ -274,6 +274,8 @@ public
self.log_event("comment", { :comment_id => comment.id })
self.save!
end
+
+ return comment
end
# The "holding pen" is a special request which stores incoming emails whose