Friday, December 15, 2023

Exposed queries assertion methods and more

Posted by Wojtek

Hi, it’s Wojtek with latest changes in the Rails codebase.

Expose queries test assertion methods
To assert the expected number of queries are made, Rails internally uses assert_queries and assert_no_queries. These assertions can now be used in applications as well.

Allow serving compressed SVG images
This adds image/svg+xml to the compressible content types of ActionDispatch::Static.

Ignore host if socket is set in Trilogy adapter
This allows to configure a connection on a UNIX socket via DATABASE_URL.

Take Active Record affixes into account for Action Mailbox database models
Fix all Action Mailbox database related models to respect table_name_prefix configuration.

Take Active Record affixes into account for Action Text database models
Follow up to do the same for Action Text models.

Add runner script option to disable executor wrap
Use bin/rails runner –skip-executor option to not wrap the runner script with an executor.

Add nulls_last and nulls_first for MySQL
Fixes the inconsistent behaviour when attempting to use ordering with nulls_first/nulls_last described in this issue.

Add support for generated columns in SQLite3 adapter
Generated columns (both stored and dynamic) are supported since version 3.31.0 of SQLite.

Add instrumentation for ActionController::Live#send_stream
Allows subscribing to send_stream events. The event payload contains the filename, disposition, and type.

You can view the whole list of changes here. We had 28 contributors to the Rails codebase this past week!

Until next time!

Subscribe to get these updates mailed to you.