mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 19:53:53 -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