diff --git a/app/controllers/at_controller.rb b/app/controllers/at_controller.rb index fe16385f4..5b29565ad 100644 --- a/app/controllers/at_controller.rb +++ b/app/controllers/at_controller.rb @@ -68,7 +68,7 @@ class AtController < ApplicationController end def find_project(id) - return [] if id<0 + return [] if id.to_i<0 at_persons = Project.find(id).users at_persons.delete_if { |u| u.id == User.current.id } end diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index c6047d227..02e74237a 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -102,13 +102,15 @@ class OrgDocumentCommentsController < ApplicationController end def destroy - @org_document_comment = OrgDocumentComment.find(params[:id]) - org = @org_document_comment.organization - if @org_document_comment.id == org.home_id - org.update_attributes(:home_id => nil) - end - if @org_document_comment.destroy - end + @org_document_comment = SubDocumentComment.find(params[:id]) + @sub_domain = @org_document_comment.sub_domain + @org_subfield = @sub_domain.org_subfield + # org = @org_document_comment.organization + # if @org_document_comment.id == org.home_id + # org.update_attributes(:home_id => nil) + # end + @org_document_comment.destroy + # end respond_to do |format| format.js end diff --git a/app/views/org_document_comments/destroy.js.erb b/app/views/org_document_comments/destroy.js.erb index 787bd3185..1e830d7bc 100644 --- a/app/views/org_document_comments/destroy.js.erb +++ b/app/views/org_document_comments/destroy.js.erb @@ -1,6 +1,6 @@ //location.reload(); <% if params[:detail_page] %> - window.location.href = '<%= organization_org_document_comments_path(:organization_id => @org_document_comment.root.organization_id)%>'; + window.location.href = '<%= org_subfield_sub_domain_sub_document_comments_path(:org_subfield_id => @org_subfield.id, :sub_domain_id => @sub_domain.id)%>'; <% else %> window.location.reload(); <% end %> \ No newline at end of file