From fc83cd5fd3811de3d847beaecad12be2f63ab845 Mon Sep 17 00:00:00 2001 From: Toks Date: Fri, 29 Mar 2013 20:19:46 -0400 Subject: [PATCH] adds comm shortcut for comment metatags --- app/logical/post_query_builder.rb | 4 ++-- app/models/tag.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/logical/post_query_builder.rb b/app/logical/post_query_builder.rb index f3a67b588..dd5a2f350 100644 --- a/app/logical/post_query_builder.rb +++ b/app/logical/post_query_builder.rb @@ -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" diff --git a/app/models/tag.rb b/app/models/tag.rb index 4856e143c..ef23c739f 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -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?