#2024: Add artcomm metatag
This commit is contained in:
@@ -233,6 +233,13 @@ class PostQueryBuilder
|
|||||||
has_constraints!
|
has_constraints!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if q[:artcomm_ids]
|
||||||
|
q[:artcomm_ids].each do |artcomm_id|
|
||||||
|
relation = relation.where(:id => ArtistCommentaryVersion.where("updater_id = ?", artcomm_id).select("post_id").uniq)
|
||||||
|
end
|
||||||
|
has_constraints!
|
||||||
|
end
|
||||||
|
|
||||||
if q[:post_id_negated]
|
if q[:post_id_negated]
|
||||||
relation = relation.where("posts.id <> ?", q[:post_id_negated])
|
relation = relation.where("posts.id <> ?", q[:post_id_negated])
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Tag < ActiveRecord::Base
|
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|child|pixiv_id|pixiv"
|
METATAGS = "-user|user|-approver|approver|commenter|comm|noter|artcomm|-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 :category, :as => [:moderator, :janitor, :contributor, :gold, :member, :anonymous, :default, :builder, :admin]
|
||||||
attr_accessible :is_locked, :as => [:moderator, :janitor, :admin]
|
attr_accessible :is_locked, :as => [:moderator, :janitor, :admin]
|
||||||
has_one :wiki_page, :foreign_key => "title", :primary_key => "name"
|
has_one :wiki_page, :foreign_key => "title", :primary_key => "name"
|
||||||
@@ -375,6 +375,11 @@ class Tag < ActiveRecord::Base
|
|||||||
user_id = User.name_to_id($2)
|
user_id = User.name_to_id($2)
|
||||||
q[:noter_ids] << user_id unless user_id.blank?
|
q[:noter_ids] << user_id unless user_id.blank?
|
||||||
|
|
||||||
|
when "artcomm"
|
||||||
|
q[:artcomm_ids] ||= []
|
||||||
|
user_id = User.name_to_id($2)
|
||||||
|
q[:artcomm_ids] << user_id unless user_id.blank?
|
||||||
|
|
||||||
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