adds comm shortcut for comment metatags

This commit is contained in:
Toks
2013-03-29 20:19:46 -04:00
parent 28f04eb1b2
commit fc83cd5fd3
2 changed files with 4 additions and 4 deletions

View File

@@ -245,10 +245,10 @@ class PostQueryBuilder
when "favcount_asc"
relation = relation.order("posts.fav_count ASC, posts.id DESC")
when "comment"
when "comment", "comm"
relation = relation.order("posts.last_commented_at DESC, posts.id DESC").where("posts.last_commented_at is not null")
when "comment_asc"
when "comment_asc", "comm_asc"
relation = relation.order("posts.last_commented_at ASC, posts.id DESC").where("posts.last_commented_at is not null")
when "note"

View File

@@ -1,5 +1,5 @@
class Tag < ActiveRecord::Base
METATAGS = "-user|user|-approver|approver|commenter|noter|-pool|pool|-fav|fav|sub|md5|-rating|rating|width|height|mpixels|score|filesize|source|id|date|order|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|pixiv"
METATAGS = "-user|user|-approver|approver|commenter|comm|noter|-pool|pool|-fav|fav|sub|md5|-rating|rating|width|height|mpixels|score|filesize|source|id|date|order|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|pixiv"
attr_accessible :category
has_one :wiki_page, :foreign_key => "name", :primary_key => "title"
@@ -280,7 +280,7 @@ class Tag < ActiveRecord::Base
q[:approver_id] = User.name_to_id($2)
q[:approver_id] = -1 if q[:approver_id].nil?
when "commenter"
when "commenter", "comm"
q[:commenter_id] = User.name_to_id($2)
q[:commenter_id] = -1 if q[:commenter_id].nil?