From 9f316834eba1dd7eee1336aa3b2731c5c21f5de5 Mon Sep 17 00:00:00 2001 From: Emmanuel Hayford Date: Fri, 29 Mar 2024 19:06:30 +0100 Subject: [PATCH] TWIR fixes --- ...nfiguration-option-and-more-b3dfc401.markdown | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/_posts/2024-03-29-this-week-in-rails-retry-known-idempotent-select-queries-new-active-record-configuration-option-and-more-b3dfc401.markdown b/_posts/2024-03-29-this-week-in-rails-retry-known-idempotent-select-queries-new-active-record-configuration-option-and-more-b3dfc401.markdown index 232e3419..f9e37a2a 100644 --- a/_posts/2024-03-29-this-week-in-rails-retry-known-idempotent-select-queries-new-active-record-configuration-option-and-more-b3dfc401.markdown +++ b/_posts/2024-03-29-this-week-in-rails-retry-known-idempotent-select-queries-new-active-record-configuration-option-and-more-b3dfc401.markdown @@ -34,19 +34,21 @@ Previously, duplication still resulted in shared internal silencers and filters Noting the typo in _:through_, take the following code sample as an example: -_class User \< ApplicationRecord -  has\_many :courses -  has\_many :assignments, trough: :courses -end_ +```ruby +class User < ApplicationRecord + has_many :courses + has_many :assignments, trough: :courses +end +``` You'd get a misleading error along the lines of -_"Unknown key: :trough. Valid keys are: :class\_name, :anonymous\_class, :primary\_key, ..., :index\_errors (ArgumentError)",_ +"Unknown key: :trough. Valid keys are: :class\_name, :anonymous\_class, :primary\_key, ..., :index\_errors (ArgumentError)", with this pull request, you'll now get a clearer message, more like: -_"Unknown key: :trough. Valid keys are: :class\_name, :anonymous\_class, :primary\_key, ..., :index\_errors, :through (ArgumentError)"._ +"Unknown key: :trough. Valid keys are: :class\_name, :anonymous\_class, :primary\_key, ..., :index\_errors, :through (ArgumentError)". Note that in the second error message _:through_ is included in the list of valid options. @@ -55,7 +57,7 @@ Implements a mechanism to automatically retry _SELECT_ queries that are known to Queries constructed through Arel tree traversal or based on known model attributes are inherently idempotent and can be safely retried upon encountering a connection error. Previously, certain adapters like _TrilogyAdapter_ would raise _ActiveRecord::ConnectionFailed: Trilogy::EOFError_ when faced with a connection error during a request. -_We had_ [_22 contributors_](https://contributors.rubyonrails.org/contributors/in-time-window/20240322-20240329) _to the Rails codebase this past week!_ +We had [22 contributors](https://contributors.rubyonrails.org/contributors/in-time-window/20240322-20240329) to the Rails codebase this past week! Take care.