fixes #1084
This commit is contained in:
@@ -202,8 +202,12 @@ class PostQueryBuilder
|
||||
has_constraints!
|
||||
end
|
||||
|
||||
if q[:parent_id]
|
||||
relation = relation.where("(posts.id = ? or posts.parent_id = ?)", q[:parent_id], q[:parent_id])
|
||||
if q[:parent] == "none"
|
||||
relation = relation.where("posts.parent_id IS NULL")
|
||||
elsif q[:parent_neg] == "none" || q[:parent] == "any"
|
||||
relation = relation.where("posts.parent_id IS NOT NULL")
|
||||
elsif q[:parent]
|
||||
relation = relation.where("(posts.id = ? or posts.parent_id = ?)", q[:parent], q[:parent])
|
||||
has_constraints!
|
||||
end
|
||||
|
||||
|
||||
@@ -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|favcount|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|-parent|pixiv_id|pixiv"
|
||||
attr_accessible :category
|
||||
has_one :wiki_page, :foreign_key => "name", :primary_key => "title"
|
||||
|
||||
@@ -366,7 +366,10 @@ class Tag < ActiveRecord::Base
|
||||
q[:copyright_tag_count] = parse_helper($2)
|
||||
|
||||
when "parent"
|
||||
q[:parent_id] = $2.to_i
|
||||
q[:parent] = $2.downcase
|
||||
|
||||
when "-parent"
|
||||
q[:parent_neg] = $2.downcase
|
||||
|
||||
when "order"
|
||||
q[:order] = $2.downcase
|
||||
|
||||
Reference in New Issue
Block a user