Skip to content

Instantly share code, notes, and snippets.

View fatkodima's full-sized avatar

fatkodima

View GitHub Profile
@fatkodima
fatkodima / inspect_queries.rb
Created January 17, 2024 00:35
Inspect db queries
# Make sure to have prepared statements enabled.
# config/database.yml
# test:
# database: ...
# prepared_statements: true
# Add this to the top scope of test/test_helper.rb or spec/rails_helper.rb and
# run tests as usual.
queries = Hash.new(0)