adds commenter: and noter: metatags
This commit is contained in:
@@ -189,6 +189,16 @@ class PostQueryBuilder
|
|||||||
has_constraints!
|
has_constraints!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if q[:commenter_id]
|
||||||
|
relation = relation.where(:id => Comment.where("creator_id = ?", q[:commenter_id]).select("post_id").uniq)
|
||||||
|
has_constraints!
|
||||||
|
end
|
||||||
|
|
||||||
|
if q[:noter_id]
|
||||||
|
relation = relation.where(:id => Note.where("creator_id = ?", q[:noter_id]).select("post_id").uniq)
|
||||||
|
has_constraints!
|
||||||
|
end
|
||||||
|
|
||||||
if q[:parent_id]
|
if q[:parent_id]
|
||||||
relation = relation.where("(posts.id = ? or posts.parent_id = ?)", q[:parent_id], q[:parent_id])
|
relation = relation.where("(posts.id = ? or posts.parent_id = ?)", q[:parent_id], q[:parent_id])
|
||||||
has_constraints!
|
has_constraints!
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Tag < ActiveRecord::Base
|
class Tag < ActiveRecord::Base
|
||||||
METATAGS = "-user|user|-approver|approver|-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|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
|
attr_accessible :category
|
||||||
has_one :wiki_page, :foreign_key => "name", :primary_key => "title"
|
has_one :wiki_page, :foreign_key => "name", :primary_key => "title"
|
||||||
|
|
||||||
@@ -280,6 +280,14 @@ class Tag < ActiveRecord::Base
|
|||||||
q[:approver_id] = User.name_to_id($2)
|
q[:approver_id] = User.name_to_id($2)
|
||||||
q[:approver_id] = -1 if q[:approver_id].nil?
|
q[:approver_id] = -1 if q[:approver_id].nil?
|
||||||
|
|
||||||
|
when "commenter"
|
||||||
|
q[:commenter_id] = User.name_to_id($2)
|
||||||
|
q[:commenter_id] = -1 if q[:commenter_id].nil?
|
||||||
|
|
||||||
|
when "noter"
|
||||||
|
q[:noter_id] = User.name_to_id($2)
|
||||||
|
q[:noter_id] = -1 if q[:noter_id].nil?
|
||||||
|
|
||||||
when "-pool"
|
when "-pool"
|
||||||
q[:tags][:exclude] << "pool:#{Pool.name_to_id($2)}"
|
q[:tags][:exclude] << "pool:#{Pool.name_to_id($2)}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user