rspec-sqlimit
на сайте с 03 мая 2023, 02:47
RSpec matcher to control number of SQL queries executed by a block of code.
It wraps the answer at Stack Overflow by Ryan Bigg, which based on Active Support Notification and Instrumentation mechanisms.
For motivation and details see my blog post "Fighting the Hydra of N+1 queries" in the Martian Chronicles.