Simplify messages_count trigger install and harden ensure!

Require all three SQLite triggers before treating the counter as installed,
drop the schema.rb / dump-rewrite install paths in favor of rake ensure after
schema load, isolate destructive trigger tests, and cover foreign room moves
plus fixture baseline counts.

Co-authored-by: Thomas Klemm <github@tklemm.eu>
This commit is contained in:
Cursor Agent
2026-10-07 19:46:57 +00:00
parent 1f5858098b
commit 9fd1563c9b
8 changed files with 73 additions and 94 deletions
@@ -103,7 +103,6 @@ class Messages::ByBotsControllerTest < ActionDispatch::IntegrationTest
json = JSON.parse(response.body)
assert_equal Message::PAGE_SIZE, json.size
assert_equal @room.reload.messages_count.to_s, response.headers["X-Total-Count"]
assert_equal "41", response.headers["X-Total-Count"]
assert_not_includes json.map { it["id"] }, messages(:fourth).id