diff --git a/app/components/comment_component/comment_component.html.erb b/app/components/comment_component/comment_component.html.erb index a0271f8be..ba79721cd 100644 --- a/app/components/comment_component/comment_component.html.erb +++ b/app/components/comment_component/comment_component.html.erb @@ -25,7 +25,7 @@ <% end %> <% end %> - <%= link_to time_ago_in_words_tagged(comment.created_at), post_path(comment.post, anchor: "comment_#{comment.id}"), class: "message-timestamp" %> + <%= link_to time_ago_in_words_tagged(comment.created_at), comment, class: "message-timestamp" %>
diff --git a/app/models/comment.rb b/app/models/comment.rb index 49cfe11e0..ded7a5008 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -21,7 +21,7 @@ class Comment < ApplicationRecord mentionable( :message_field => :body, :title => ->(user_name) {"#{creator.name} mentioned you in a comment on post ##{post_id}"}, - :body => ->(user_name) {"@#{creator.name} mentioned you in a \"comment\":#{Routes.post_path(post, anchor: "comment-#{id}")} on post ##{post_id}:\n\n[quote]\n#{DText.extract_mention(body, "@" + user_name)}\n[/quote]\n"} + :body => ->(user_name) {"@#{creator.name} mentioned you in comment ##{id} on post ##{post_id}:\n\n[quote]\n#{DText.extract_mention(body, "@" + user_name)}\n[/quote]\n"} ) module SearchMethods diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb index 5b859b231..a050cc5b1 100644 --- a/test/unit/comment_test.rb +++ b/test/unit/comment_test.rb @@ -71,7 +71,7 @@ class CommentTest < ActiveSupport::TestCase dmail = Dmail.last assert_equal(<<-EOS.strip_heredoc, dmail.body) - @#{@comment.creator.name} mentioned you in a \"comment\":/posts/#{@comment.post_id}#comment-#{@comment.id} on post ##{@comment.post_id}: + @#{@comment.creator.name} mentioned you in comment ##{@comment.id} on post ##{@comment.post_id}: [quote] Hey @#{@user2.name} check this out!