This commit is contained in:
albert
2013-03-23 11:49:25 -04:00
parent d0cc68ecb7
commit 0cfaed99e0
3 changed files with 16 additions and 1 deletions

View File

@@ -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]

View File

@@ -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

View File

@@ -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