mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Add Topic#url for determining url for a Topic
This commit is contained in:
parent
f2b5e20840
commit
b8fbac582e
1 changed files with 4 additions and 0 deletions
|
@ -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 a new issue