From 8a9df7d4bdeefc27a68f285bf78af987c78144d0 Mon Sep 17 00:00:00 2001 From: Toks Date: Sat, 6 Apr 2013 13:33:23 -0400 Subject: [PATCH] fixes #1218 --- app/logical/post_query_builder.rb | 1 + app/models/tag.rb | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/logical/post_query_builder.rb b/app/logical/post_query_builder.rb index 19191ee4c..67659e132 100644 --- a/app/logical/post_query_builder.rb +++ b/app/logical/post_query_builder.rb @@ -117,6 +117,7 @@ class PostQueryBuilder relation = add_range_relation(q[:width], "posts.image_width", relation) relation = add_range_relation(q[:height], "posts.image_height", relation) relation = add_range_relation(q[:score], "posts.score", relation) + relation = add_range_relation(q[:fav_count], "posts.fav_count", relation) relation = add_range_relation(q[:filesize], "posts.file_size", relation) relation = add_range_relation(q[:date], "posts.created_at", relation) relation = add_range_relation(q[:general_tag_count], "posts.tag_count_general", relation) diff --git a/app/models/tag.rb b/app/models/tag.rb index 303da5df8..af6004781 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|comm|noter|-pool|pool|-fav|fav|sub|md5|-rating|rating|-locked|locked|width|height|mpixels|score|filesize|source|id|date|order|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|pixiv_id|pixiv" + METATAGS = "-user|user|-approver|approver|commenter|comm|noter|-pool|pool|-fav|fav|sub|md5|-rating|rating|-locked|locked|width|height|mpixels|score|favcount|filesize|source|id|date|order|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|pixiv_id|pixiv" attr_accessible :category has_one :wiki_page, :foreign_key => "name", :primary_key => "title" @@ -338,6 +338,9 @@ class Tag < ActiveRecord::Base when "score" q[:score] = parse_helper($2) + when "favcount" + q[:fav_count] = parse_helper($2) + when "filesize" q[:filesize] = parse_helper($2, :filesize)