mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -06:00
Add Topic#url for determining url for a Topic
This commit is contained in:
parent
f2b5e20840
commit
b8fbac582e
@ -682,6 +682,10 @@ class Topic < ActiveRecord::Base
|
||||
url
|
||||
end
|
||||
|
||||
def url(post_number = nil)
|
||||
self.class.url id, slug, post_number
|
||||
end
|
||||
|
||||
def relative_url(post_number=nil)
|
||||
url = "/t/#{slug}/#{id}"
|
||||
url << "/#{post_number}" if post_number.to_i > 1
|
||||
|
Loading…
Reference in New Issue
Block a user