swap method location for neatness

This commit is contained in:
Toks
2013-04-05 13:10:55 -04:00
parent f7fa452d88
commit 90513d89ce

View File

@@ -101,6 +101,13 @@ class Comment < ActiveRecord::Base
end
end
def update_last_commented_at_on_create
if Comment.where("post_id = ?", post_id).count <= Danbooru.config.comment_threshold && !do_not_bump_post?
Post.update_all(["last_commented_at = ?", created_at], ["id = ?", post_id])
end
true
end
def update_last_commented_at_on_destroy
other_comments = Comment.where("post_id = ? and id <> ?", post_id, id).order("id DESC")
if other_comments.count == 0
@@ -111,13 +118,6 @@ class Comment < ActiveRecord::Base
true
end
def update_last_commented_at_on_create
if Comment.where("post_id = ?", post_id).count <= Danbooru.config.comment_threshold && !do_not_bump_post?
Post.update_all(["last_commented_at = ?", created_at], ["id = ?", post_id])
end
true
end
def do_not_bump_post?
do_not_bump_post == "1"
end