]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/issues_controller.rb
Create an IssueCommentsController for managing IssueComments
[rails.git] / app / controllers / issues_controller.rb
index 534cc2fde31e0f45b4430f88d1c13f527087a09e..e156ea004ba651face0adc69355894f69803930a 100644 (file)
@@ -58,6 +58,7 @@ class IssuesController < ApplicationController
     @unread_reports = @issue.unread_reports
     @comments = @issue.comments
     @related_issues = @issue.reported_user.issues.where(:issue_type => @user_role)
+    @new_comment = IssueComment.new(:issue => @issue)
   end
 
   def update
@@ -94,25 +95,6 @@ class IssuesController < ApplicationController
     end
   end
 
-  def comment
-    @issue = Issue.find(params[:id])
-    if issue_comment_params.blank?
-      notice = t("issues.comment.provide_details")
-    else
-      @issue_comment = @issue.comments.build(issue_comment_params)
-      @issue_comment.commenter_user_id = current_user.id
-      if params[:reassign]
-        reassign_issue
-        @issue_comment.reassign = true
-      end
-      @issue_comment.save!
-      @issue.updated_by = current_user.id
-      @issue.save!
-      notice = t("issues.comment.comment_created")
-    end
-    redirect_to @issue, :notice => notice
-  end
-
   # Status Transistions
   def resolve
     if @issue.resolve