modqueue: optimize sql queries.

* Include appeals and flags.
* Avoid an existence query for pools.
* Avoid a query checking if the user has previously approved the post.
  This is a rare condition and it will be prevented anyway if the user
  tries to reapprove the post.
This commit is contained in:
evazion
2020-02-29 12:52:07 -06:00
parent b232470248
commit 980103e443
4 changed files with 4 additions and 15 deletions

View File

@@ -22,10 +22,6 @@ class PostApprovalTest < ActiveSupport::TestCase
CurrentUser.ip_addr = nil
end
should "allow approval" do
assert_equal(false, @post.approved_by?(@approver))
end
context "That is approved" do
should "create a postapproval record" do
assert_difference("PostApproval.count") do