fix parent metatag search
This commit is contained in:
@@ -710,6 +710,10 @@ class Post < ActiveRecord::Base
|
||||
relation = relation.where("posts.approver_id = ?", q[:approver_id])
|
||||
end
|
||||
|
||||
if q[:parent_id]
|
||||
relation = relation.where("(posts.id = ? or posts.parent_id = ?)", q[:parent_id], q[:parent_id])
|
||||
end
|
||||
|
||||
if q[:rating] == "q"
|
||||
relation = relation.where("posts.rating = 'q'")
|
||||
elsif q[:rating] == "s"
|
||||
|
||||
@@ -213,7 +213,7 @@ class Tag < ActiveRecord::Base
|
||||
}
|
||||
|
||||
scan_query(query).each do |token|
|
||||
if token =~ /\A(-uploader|uploader|-approver|approver|-pool|pool|-fav|fav|sub|md5|-rating|rating|width|height|mpixels|score|filesize|source|id|date|order|status|tagcount|gentags|arttags|chartags|copytags):(.+)\Z/
|
||||
if token =~ /\A(-uploader|uploader|-approver|approver|-pool|pool|-fav|fav|sub|md5|-rating|rating|width|height|mpixels|score|filesize|source|id|date|order|status|tagcount|gentags|arttags|chartags|copytags|parent):(.+)\Z/
|
||||
case $1
|
||||
when "-uploader"
|
||||
q[:uploader_id_neg] ||= []
|
||||
@@ -293,6 +293,9 @@ class Tag < ActiveRecord::Base
|
||||
when "copytags"
|
||||
q[:copyright_tag_count] = parse_helper($2)
|
||||
|
||||
when "parent"
|
||||
q[:parent_id] = $2.to_i
|
||||
|
||||
when "order"
|
||||
q[:order] = $2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user