fixes #1056
This commit is contained in:
@@ -137,8 +137,16 @@ class PostQueryBuilder
|
||||
relation = relation.where("posts.is_flagged = TRUE")
|
||||
elsif q[:status] == "deleted"
|
||||
relation = relation.where("posts.is_deleted = TRUE")
|
||||
elsif q[:status] == "banned"
|
||||
relation = relation.where("posts.is_banned = TRUE")
|
||||
elsif q[:status] == "all" || q[:status] == "any"
|
||||
# do nothing
|
||||
elsif q[:status_neg] == "pending"
|
||||
relation = relation.where("posts.is_pending = FALSE")
|
||||
elsif q[:status_neg] == "flagged"
|
||||
relation = relation.where("posts.is_flagged = FALSE")
|
||||
elsif q[:status_neg] == "deleted"
|
||||
relation = relation.where("posts.is_deleted = FALSE")
|
||||
end
|
||||
|
||||
if q[:source]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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|tagcount|gentags|arttags|chartags|copytags|parent|pixiv"
|
||||
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"
|
||||
attr_accessible :category
|
||||
has_one :wiki_page, :foreign_key => "name", :primary_key => "title"
|
||||
|
||||
@@ -350,6 +350,9 @@ class Tag < ActiveRecord::Base
|
||||
when "order"
|
||||
q[:order] = $2.downcase
|
||||
|
||||
when "-status"
|
||||
q[:status_neg] = $2.downcase
|
||||
|
||||
when "status"
|
||||
q[:status] = $2.downcase
|
||||
|
||||
|
||||
@@ -10,5 +10,9 @@ class AddIsBannedToPosts < ActiveRecord::Migration
|
||||
PostFlag.where("reason ilike '%requested%' and reason <> 'Artist requested removal'").each do |flag|
|
||||
flag.post.update_column(:is_banned, true)
|
||||
end
|
||||
|
||||
PostFlag.where("reason ilike '%banned artist%'").each do |flag|
|
||||
flag.post.update_column(:is_banned, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user