mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 02:52:44 +08: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
|
url
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def url(post_number = nil)
|
||||||
|
self.class.url id, slug, post_number
|
||||||
|
end
|
||||||
|
|
||||||
def relative_url(post_number=nil)
|
def relative_url(post_number=nil)
|
||||||
url = "/t/#{slug}/#{id}"
|
url = "/t/#{slug}/#{id}"
|
||||||
url << "/#{post_number}" if post_number.to_i > 1
|
url << "/#{post_number}" if post_number.to_i > 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user