♊️ GemiNews 🗞️
(dev)
🏡
📰 Articles
🏷️ Tags
🧠 Queries
📈 Graphs
☁️ Stats
💁🏻 Assistant
💬
🎙️
Demo 1: Embeddings + Recommendation
Demo 2: Bella RAGa
Demo 3: NewRetriever
Demo 4: Assistant function calling
Editing article
Title
Summary
Greetings! I’m Emmanuel Hayford, here to bring you your weekly instalment of “This Week In Rails”. Let’s dive straight into it. Two new guides are now open for community review. If you are well versed in Action View, partials, and helpers, please review and submit your feedback here:
Content
<p>Greetings! I’m <a href="https://twitter.com/siaw23">Emmanuel Hayford</a>, here to bring you your weekly instalment of “This Week In Rails”. Let’s dive straight into it. Two new guides are now open for community review. If you are well versed in Action View, partials, and helpers, please review and submit your feedback here:</p> <ul> <li><a href="https://github.com/rails/rails/pull/51435">Action View Overview PR</a></li> <li><a href="https://github.com/rails/rails/pull/51432">Action View Helpers PR</a></li> </ul> <p><a href="https://github.com/rails/rails/pull/51349">Add config.active_record.permanent_connection_checkout setting</a> This setting determines the action taken when <em>ActiveRecord::Base.connection</em> is accessed: whether it raises an error, emits a deprecation warning, or does nothing.</p> <p><em>ActiveRecord::Base.connection</em> acquires a database connection from the pool and maintains it until the request or job concludes. However, this behaviour may prove undesirable in environments with more threads or fibers than available connections.</p> <p>This configuration facilitates the identification and elimination of code utilising <em>ActiveRecord::Base.connection</em>, encouraging migration to <em>ActiveRecord::Base.with_connection</em> instead. The default behaviour remains unaltered.</p> <p><a href="https://github.com/rails/rails/pull/51447">Make ActiveSupport::BacktraceCleaner copy filters on dup</a> Enhance <em>ActiveSupport::BacktraceCleaner</em> to replicate filters and silencers during duplication and cloning.</p> <p>Previously, duplication still resulted in shared internal silencers and filters arrays, leading to state leakage.</p> <p><a href="https://github.com/rails/rails/pull/51408">Ensure necessary options are added to association options</a></p> <p>Noting the typo in <em>:through</em>, take the following code sample as an example:</p> <div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">class</span> <span class="nc">User</span> <span class="o"><</span> <span class="no">ApplicationRecord</span> <span class="n">has_many</span> <span class="ss">:courses</span> <span class="n">has_many</span> <span class="ss">:assignments</span><span class="p">,</span> <span class="ss">trough: :courses</span> <span class="k">end</span> </code></pre></div></div> <p>You’d get a misleading error along the lines of</p> <p>“Unknown key: :trough. Valid keys are: :class_name, :anonymous_class, :primary_key, …, :index_errors (ArgumentError)”,</p> <p>with this pull request, you’ll now get a clearer message, more like:</p> <p>“Unknown key: :trough. Valid keys are: :class_name, :anonymous_class, :primary_key, …, :index_errors, :through (ArgumentError)”.</p> <p>Note that in the second error message <em>:through</em> is included in the list of valid options.</p> <p><a href="https://github.com/rails/rails/pull/51336">Retry known idempotent SELECT queries on connection-related exceptions</a> Implements a mechanism to automatically retry <em>SELECT</em> queries that are known to be idempotent in the event of connection-related exceptions.</p> <p>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 <em>TrilogyAdapter</em> would raise <em>ActiveRecord::ConnectionFailed: Trilogy::EOFError</em> when faced with a connection error during a request.</p> <p>We had <a href="https://contributors.rubyonrails.org/contributors/in-time-window/20240322-20240329">22 contributors</a> to the Rails codebase this past week!</p> <p>Take care.</p> <p>Your weekly inside scoop of interesting commits, pull requests and more from <a href="https://github.com/rails/rails"><strong>Rails</strong></a>.</p> <p><i><a href="https://world.hey.com/this.week.in.rails">Subscribe</a> to get these updates mailed to you.</i></p>
Author
Link
Published date
Image url
Feed url
Guid
Hidden blurb
--- !ruby/object:Feedjira::Parser::AtomEntry author: Emmanuel Hayford content: |- <p>Greetings! I’m <a href="https://twitter.com/siaw23">Emmanuel Hayford</a>, here to bring you your weekly instalment of “This Week In Rails”. Let’s dive straight into it. Two new guides are now open for community review. If you are well versed in Action View, partials, and helpers, please review and submit your feedback here:</p> <ul> <li><a href="https://github.com/rails/rails/pull/51435">Action View Overview PR</a></li> <li><a href="https://github.com/rails/rails/pull/51432">Action View Helpers PR</a></li> </ul> <p><a href="https://github.com/rails/rails/pull/51349">Add config.active_record.permanent_connection_checkout setting</a> This setting determines the action taken when <em>ActiveRecord::Base.connection</em> is accessed: whether it raises an error, emits a deprecation warning, or does nothing.</p> <p><em>ActiveRecord::Base.connection</em> acquires a database connection from the pool and maintains it until the request or job concludes. However, this behaviour may prove undesirable in environments with more threads or fibers than available connections.</p> <p>This configuration facilitates the identification and elimination of code utilising <em>ActiveRecord::Base.connection</em>, encouraging migration to <em>ActiveRecord::Base.with_connection</em> instead. The default behaviour remains unaltered.</p> <p><a href="https://github.com/rails/rails/pull/51447">Make ActiveSupport::BacktraceCleaner copy filters on dup</a> Enhance <em>ActiveSupport::BacktraceCleaner</em> to replicate filters and silencers during duplication and cloning.</p> <p>Previously, duplication still resulted in shared internal silencers and filters arrays, leading to state leakage.</p> <p><a href="https://github.com/rails/rails/pull/51408">Ensure necessary options are added to association options</a></p> <p>Noting the typo in <em>:through</em>, take the following code sample as an example:</p> <div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">class</span> <span class="nc">User</span> <span class="o"><</span> <span class="no">ApplicationRecord</span> <span class="n">has_many</span> <span class="ss">:courses</span> <span class="n">has_many</span> <span class="ss">:assignments</span><span class="p">,</span> <span class="ss">trough: :courses</span> <span class="k">end</span> </code></pre></div></div> <p>You’d get a misleading error along the lines of</p> <p>“Unknown key: :trough. Valid keys are: :class_name, :anonymous_class, :primary_key, …, :index_errors (ArgumentError)”,</p> <p>with this pull request, you’ll now get a clearer message, more like:</p> <p>“Unknown key: :trough. Valid keys are: :class_name, :anonymous_class, :primary_key, …, :index_errors, :through (ArgumentError)”.</p> <p>Note that in the second error message <em>:through</em> is included in the list of valid options.</p> <p><a href="https://github.com/rails/rails/pull/51336">Retry known idempotent SELECT queries on connection-related exceptions</a> Implements a mechanism to automatically retry <em>SELECT</em> queries that are known to be idempotent in the event of connection-related exceptions.</p> <p>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 <em>TrilogyAdapter</em> would raise <em>ActiveRecord::ConnectionFailed: Trilogy::EOFError</em> when faced with a connection error during a request.</p> <p>We had <a href="https://contributors.rubyonrails.org/contributors/in-time-window/20240322-20240329">22 contributors</a> to the Rails codebase this past week!</p> <p>Take care.</p> <p>Your weekly inside scoop of interesting commits, pull requests and more from <a href="https://github.com/rails/rails"><strong>Rails</strong></a>.</p> <p><i><a href="https://world.hey.com/this.week.in.rails">Subscribe</a> to get these updates mailed to you.</i></p> title_type: html title: Retry known idempotent SELECT queries, New Active Record configuration option, and more! links: - https://rubyonrails.org/2024/3/29/this-week-in-rails-retry-known-idempotent-select-queries-new-active-record-configuration-option-and-more-b3dfc401 published: 2024-03-29 00:00:00.000000000 Z entry_id: https://rubyonrails.org/2024/3/29/this-week-in-rails-retry-known-idempotent-select-queries-new-active-record-configuration-option-and-more-b3dfc401 summary: 'Greetings! I’m Emmanuel Hayford, here to bring you your weekly instalment of “This Week In Rails”. Let’s dive straight into it. Two new guides are now open for community review. If you are well versed in Action View, partials, and helpers, please review and submit your feedback here:' categories: - news carlessian_info: news_filer_version: 2 newspaper: Ruby on Rails macro_region: Technology rss_fields: - author - content - title_type - title - links - published - entry_id - summary - categories - url - updated - raw_title url: https://rubyonrails.org/2024/3/29/this-week-in-rails-retry-known-idempotent-select-queries-new-active-record-configuration-option-and-more-b3dfc401 updated: 2024-03-29 00:00:00.000000000 Z raw_title: Retry known idempotent SELECT queries, New Active Record configuration option, and more!
Language
Active
Ricc internal notes
Imported via /Users/ricc/git/gemini-news-crawler/webapp/db/seeds.d/import-feedjira.rb on 2024-04-01 22:13:51 +0200. Content is EMPTY here. Entried: author,content,title_type,title,links,published,entry_id,summary,categories,url,updated,raw_title. TODO add Newspaper: filename = /Users/ricc/git/gemini-news-crawler/webapp/db/seeds.d/../../../crawler/out/feedjira/Technology/Ruby on Rails/2024-03-29-Retry_known_idempotent_SELECT_queries,_New_Active_Record_configu-v2.yaml
Ricc source
Show this article
Back to articles