From d54427df2124b8853765ea25bc222effa25e9528 Mon Sep 17 00:00:00 2001 From: joshua stein Date: Thu, 24 Mar 2016 13:19:26 -0500 Subject: [PATCH] make 'link' on comments use very short url --- app/models/comment.rb | 6 +++--- app/views/comments/_comment.html.erb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/comment.rb b/app/models/comment.rb index dba36ca..776368b 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -114,7 +114,7 @@ class Comment < ActiveRecord::Base def as_json(options = {}) h = [ :short_id, - { :short_id_url => Rails.application.root_url + "c/#{self.short_id}" }, + :short_id_url, :created_at, :updated_at, :is_deleted, @@ -392,11 +392,11 @@ class Comment < ActiveRecord::Base end def short_id_path - self.story.short_id_path + "/_/comments/#{self.short_id}#c_#{self.short_id}" + self.story.short_id_path + "/c/#{self.short_id}" end def short_id_url - self.story.short_id_url + "/_/comments/#{self.short_id}#c_#{self.short_id}" + Rails.application.root_url + "c/#{self.short_id}" end def to_param diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 80ce1a9..4d728df 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -63,7 +63,7 @@ class="comment <%= comment.current_vote ? (comment.current_vote[:vote] == 1 ? <% if !comment.previewing %> | - link + link <% if comment.is_editable_by_user?(@user) %> |