mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 22:37:37 +08:00
REFACTOR: All kinds of permalinks should return relative URLs
Mixing relative and absolute URLs is unnecessary and confusing.
This commit is contained in:

committed by
Gerhard Schlager

parent
4e80c9eb13
commit
387e906610
@ -72,11 +72,11 @@ class Permalink < ActiveRecord::Base
|
||||
|
||||
def target_url
|
||||
return external_url if external_url
|
||||
return "#{Discourse.base_path}#{post.url}" if post
|
||||
return post.relative_url if post
|
||||
return topic.relative_url if topic
|
||||
return category.url if category
|
||||
return tag.full_url if tag
|
||||
return user.full_url if user
|
||||
return category.relative_url if category
|
||||
return tag.relative_url if tag
|
||||
return user.relative_url if user
|
||||
nil
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user