edit link for original forum post goes to edit topic action

This commit is contained in:
albert
2013-02-25 09:39:27 -05:00
parent 0d20f5b5a6
commit 00934a1e13
4 changed files with 12 additions and 3 deletions

View File

@@ -118,6 +118,10 @@ class ForumPost < ActiveRecord::Base
((ForumPost.where("topic_id = ? and created_at <= ?", topic_id, created_at).count) / Danbooru.config.posts_per_page.to_f).ceil
end
def is_original_post?
ForumPost.exists?(["id = ? and id = (select _.id from forum_posts _ where _.topic_id = ? order by _.id asc limit 1)", id, topic_id])
end
def build_response
dup.tap do |x|
x.body = x.quoted_response