2
0
mirror of https://github.com/moebooru/moebooru synced 2025-09-05 00:15:10 +00:00

holds:false to hide posts, for the api where the default is holds:all

--HG--
branch : moe
extra : convert_revision : svn%3A2d28d66d-8d94-df11-8c86-00306ef368cb/trunk/moe%40732
This commit is contained in:
petopeto
2010-12-02 06:54:24 +00:00
parent 6b21e24055
commit 272c744c91
3 changed files with 10 additions and 5 deletions

View File

@@ -245,9 +245,12 @@ module PostSqlMethods
conds << "p.status = 'flagged'"
end
if q.has_key?(:show_holds_only)
if q[:show_holds_only]
if q.has_key?(:show_holds)
if q[:show_holds] == :only
conds << "p.is_held"
elsif q[:show_holds] == :hide
conds << "NOT p.is_held"
elsif q[:show_holds] == :yes
end
else
# Hide held posts by default only when not using the API.