This commit is contained in:
Toks
2013-10-09 14:19:29 -04:00
parent 34716298b6
commit ea41c1b86a
2 changed files with 10 additions and 1 deletions

View File

@@ -246,6 +246,12 @@ class PostQueryBuilder
has_constraints!
end
if q[:child] == "none"
relation = relation.where("posts.has_children = FALSE")
elsif q[:child] == "any"
relation = relation.where("posts.has_children = TRUE")
end
if q[:rating] =~ /^q/
relation = relation.where("posts.rating = 'q'")
elsif q[:rating] =~ /^s/

View File

@@ -1,5 +1,5 @@
class Tag < ActiveRecord::Base
METATAGS = "-user|user|-approver|approver|commenter|comm|noter|-pool|pool|-fav|fav|ordfav|sub|md5|-rating|rating|-locked|locked|width|height|mpixels|score|favcount|filesize|source|-source|id|-id|date|age|order|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|-parent|pixiv_id|pixiv"
METATAGS = "-user|user|-approver|approver|commenter|comm|noter|-pool|pool|-fav|fav|ordfav|sub|md5|-rating|rating|-locked|locked|width|height|mpixels|score|favcount|filesize|source|-source|id|-id|date|age|order|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|-parent|child|pixiv_id|pixiv"
attr_accessible :category, :as => [:moderator, :janitor, :contributor, :gold, :member, :anonymous, :default, :builder, :admin]
attr_accessible :is_locked, :as => [:moderator, :janitor, :admin]
has_one :wiki_page, :foreign_key => "title", :primary_key => "name"
@@ -474,6 +474,9 @@ class Tag < ActiveRecord::Base
when "-parent"
q[:parent_neg] = $2.downcase
when "child"
q[:child] = $2.downcase
when "order"
q[:order] = $2.downcase