fix counts

This commit is contained in:
albert
2013-03-22 21:18:13 -04:00
parent 6f5c29df37
commit ee1a70033c
8 changed files with 21 additions and 9 deletions

View File

@@ -120,7 +120,7 @@ class ForumPost < ActiveRecord::Base
end
def forum_topic_page
((ForumPost.where("topic_id = ? and created_at <= ?", topic_id, created_at).count) / CurrentUser.user.per_page.to_f).ceil
((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?

View File

@@ -56,7 +56,7 @@ class ForumTopic < ActiveRecord::Base
end
def last_page
(posts.count / CurrentUser.user.per_page.to_f).ceil
(posts.count / Danbooru.config.posts_per_page.to_f).ceil
end
def presenter(forum_posts)