FEATURE: New modal to show flags received for a user

This commit is contained in:
Robin Ward
2018-01-17 13:03:14 -05:00
parent ec65ae76b9
commit 34ed6088b9
15 changed files with 121 additions and 42 deletions

View File

@ -145,6 +145,16 @@ module FlagQuery
post_actions = post_actions.where("topics.id = ?", opts[:topic_id])
end
if opts[:user_id]
post_actions = post_actions.where("posts.user_id = ?", opts[:user_id])
end
if opts[:filter] == 'without_custom'
return post_actions.where(
'post_action_type_id' => PostActionType.flag_types_without_custom.values
)
end
if opts[:filter] == "old"
post_actions.where("post_actions.disagreed_at IS NOT NULL OR
post_actions.deferred_at IS NOT NULL OR