Friday, November 27, 2026

credentials:keys, bulk Action Text, and more!

Posted by Emmanuel Hayford

You can now list credential keys without printing their values, Action Text stops querying once per attachment, and Action Mailer boots without Active Job. Here’s what’s new in Rails:

Add bin/rails credentials:keys
Lists every key in the credentials file without the secrets. Paths use the same dot notation as credentials:fetch, so you can check what is set in production without revealing anything.

$ bin/rails credentials:keys --environment production
aws.access_key_id
aws.secret_access_key
secret_key_base

Check the encrypted file key length when decrypting
A key of the wrong length used to raise only on write. Reading now raises ActiveSupport::EncryptedFile::InvalidKeyLengthError too. The credentials and encrypted commands print that error and exit 1, and edit fails before opening the editor.

Only draw Action Mailbox conductor routes in local environments
The inbox inspector at /rails/conductor is now prepended only when Rails.env.local?, the same way /rails/mailers already works. Production no longer exposes those routes.

Let Action Mailer load without Active Job, and fix TestCase when Active Job is missing
config.load_defaults no longer sets config.action_mailer.delivery_job, which loaded Active Job as soon as Action Mailer loaded. Apps that send mail without the activejob gem now boot. ActionMailer::TestCase and the synchronous email assertions work in those apps too. The Active Job railtie still wires up helpers for enqueued emails automatically.

Don’t run deliver callbacks when no email was built
If a mailer action never called mail, or a before_action halted it, deliver_now and deliver_later still ran the deliver callbacks. They now skip those callbacks unless an email was actually built.

Locate Action Text attachables in bulk
Rendering rich text with N attachments used to cost N queries, one SGID lookup each. Attachables, galleries included, are now located in bulk, one query per model class, and memoized per content instance. Saving a body with many attachments no longer re-renders the body once per attachment either.

Locate an Array of records passed to a job with one query per model
MyJob.perform_later(users) used to run one query per record when the job ran. Deserialization now loads each model class once. If a record appears more than once in the array, each position gets the same instance.

Don’t share the query cache with Live streams, and give Live actions the request’s event reporter context
Two ActionController::Live thread-isolation fixes landed together:

  • The streaming thread inherited the request’s query cache, so repeated reads inside a stream returned stale results. Live streams no longer reuse that cache.
  • Live actions run on a pooled thread that kept another request’s Rails.event context and tags. Events now carry the context of the request that started the stream.

Add enforced: to add_check_constraint, and change_check_constraint for PostgreSQL 19+
add_check_constraint accepts enforced: false on PostgreSQL 18+ to create a NOT ENFORCED constraint. On PostgreSQL 19+, change_check_constraint toggles a constraint between ENFORCED and NOT ENFORCED. Changing it to ENFORCED checks all existing rows.

add_check_constraint :products, "price > 0", name: "price_check", enforced: false
change_check_constraint :products, name: "price_check", enforced: true

Rename default_order to fallback_order
The query method that supplies an order only when none is set is now fallback_order. reorder also clears it, so Post.fallback_order(:title).reorder(nil) is unordered.

Fix disable_joins associations ignoring the rest of their scope
Lazily loading a disable_joins association applied only the conditions and order. select, limit, includes, readonly, and strict_loading from the scope are now applied too.

Raise ActionController::BadRequest for every Rack::BadRequest
Malformed request bodies that Rack tags with Rack::BadRequest, such as BoundaryTooLongError or MultipartPartLimitError, escaped as 500s. They are now 400s, matching the other parameter parse errors.

Handle escaped quotes in Accept header parameters
Quoted parameters in an Accept header can contain escaped characters. Parsing now recognizes those, so a header that used to fail as malformed is accepted.

Return a plain String when truncate_bytes cuts an html_safe string
Truncating a SafeBuffer escaped its markup and could return more bytes than requested. Cutting now returns a plain String, matching truncate.

Ignore a schema cache dump that can’t be deserialized
A dump can reference classes that no longer exist. Loading it used to raise at boot. Rails now skips that dump and rebuilds the cache instead.

Honor DATE_FORMATS overrides of built-in formats
Assigning Time::DATE_FORMATS[:short] had no effect because to_fs(:short) kept the frozen built-in. An override now applies. ActiveSupport::TimeFormats.register still replaces a built-in format.

Bump the minimum supported SQLite version to 3.37.0
The adapter has used pragma_table_list since Rails 8.0. On SQLite 3.35 and 3.36, table listing failed with “no such table: pragma_table_list”. That requirement is now explicit.

Fix db:system:change Dockerfile packages, and replace build-essential in generated Dockerfiles
rails db:system:change now updates Dockerfile packages for current and older generated apps. New Dockerfiles install gcc, g++, and make instead of the heavier build-essential metapackage.

Update the default Node.js version for new apps to 26.13.1
The .node-version file generated for new applications now pins Node 26.13.1.

Deprecate a positional table name in Arel::Table.new
Pass name: instead. Arel::Table.new(:users) still works, with a deprecation warning.

Arel::Table.new(name: :users)

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

Until next time!

Subscribe to get these updates mailed to you.