posts with no url should return a 404

This commit is contained in:
Sam 2015-08-12 07:28:36 +10:00
parent 267d8be1f5
commit 75b4972682
1 changed files with 5 additions and 1 deletions

View File

@ -340,7 +340,11 @@ class Post < ActiveRecord::Base
end end
def url def url
Post.url(topic.slug, topic.id, post_number) if topic
Post.url(topic.slug, topic.id, post_number)
else
"/404"
end
end end
def self.url(slug, topic_id, post_number) def self.url(slug, topic_id, post_number)