---
title: "ActiveRecord::Core#inspect woes"
publication: "Ruby Weekly"
issue: 701
published_at: "2024-05-02"
canonical_url: "https://rubyweekly.com/issues/701"
---

Plus speed, audit trails, SQLite backups, and why you might use Kafka with Ruby. |        

#​701 — May 2, 2024 

[Read on the Web](https://rubyweekly.com/issues/701)  

Together with [![Memetria\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,w_600,h_145/e_make_transparent/co_white,e_outline:7/vvpdctzacmq3xehpvwps.png)](https://dashboard.memetria.com/rubyweekly/)   

Ruby Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/lrogle8y1amh7jkwwpd0.jpg)](https://railsatscale.com/2024-04-30-fixing-a-footgun-in-activerecord-core-inspect/)  

[Fixing a Footgun in `ActiveRecord::Core#inspect`](https://railsatscale.com/2024-04-30-fixing-a-footgun-in-activerecord-core-inspect/) — Objects have an `inspect` method that returns a string representation that can be useful in development and debugging. ActiveRecord objects do too, with some added enhancements to highlight what you need to know. It turns out, however, inadvertently calling on `ActiveRecord::Core#inspect` in production can cause real performance issues.. 

Andrew Novoselac   

[Explaining Thruster, 37signals' HTTP/2 Proxy to Speed Up Your App](https://discuss.rubyonrails.org/t/explaining-thruster-a-new-37signals-gem-that-speeds-up-your-app/85567) — Available as a gem, though written in Go, Thruster is an HTTP/2 proxy server that addresses some of Puma’s shortfalls around serving assets. Thruster is one of many options, which Bruno explains in this _good-enough-to-have-been-a-blog-post_ discussion. 

Breno Gazzola   [![\](https://copm.s3.amazonaws.com/ea535cfc.png)](https://dashboard.memetria.com/rubyweekly/) 

[Memetria: Secure, Scalable Redis Hosting](https://dashboard.memetria.com/rubyweekly/) — High performance Redis hosting with large key tracking, detailed metrics, and a superior uptime record. 

Memetria sponsor   

[Ruby Might Be Faster Than You Think](https://www.johnhawthorn.com/2024/ruby-might-be-faster-than-you-think/) — The “Ruby is Slow” mantra is so often chanted that many probably accept it without thought, but here’s a case where some minor tweaks result in Ruby being 5X _faster_ than the compared language. (Say it with me “Ruby is fast enough.”) 

John Hawthorn   

[JRuby 9.4.7.0 Released](https://www.jruby.org/2024/04/29/jruby-9-4-7-0.html) — The long standing, reliable, and performant JVM-based Ruby implementation takes another gentle step forward with dependency updates and several fixed edge cases. 

The JRuby Team   

- 📅 If you wanted to attend _Rails World_ (mentioned last week), I hope you got a ticket as apparently they [sold out in under 20 minutes.](https://twitter.com/rails/status/1785358907957035260) A second, smaller batch of tickets is tempted for a later date, however.
- 🇸🇪 If you want an event you _can_ still get a ticket for, [Baltic Ruby](https://balticruby.org/) takes place in Sweden next month (June 13-15) with **Matz attending in person** – his first talk in Europe for some years. He's also speaking at [Red Dot Ruby](https://reddotrubyconf.com/) in Singapore in July.
- 💻 DHH's latest thing is ["moving continuous integration back to developer machines"](https://world.hey.com/dhh/we-re-moving-continuous-integration-back-to-developer-machines-3ac6c611) in a further effort to reduce complexity.
- 🎂 I suspect many Rubyists will have written some BASIC once – it's where I started – so congratulations to [the BASIC language turning 60 years old](https://arstechnica.com/gadgets/2024/05/the-basic-programming-language-turns-60/).
- 📉 [Over on Reddit,](https://www.reddit.com/r/ruby/comments/1ccreey/ruby_331_performance_measurements_no_more_memory/) someone has observed that the new Ruby 3.3.1 seems to have resolved some of Ruby's recent memory leak issues.
- 🐦 [Ruby LSP now supports](https://twitter.com/vinistock/status/1783190937054728433) _Go to Definition_ for methods.  

📄 Articles, Tutorials & Videos 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/wpw09jwjfvgyghe4f91v.jpg)](https://blog.bemi.io/audit-trail-in-ruby/)  

[Choosing the Right Audit Trail Approach in Ruby](https://blog.bemi.io/audit-trail-in-ruby/) — A look across the vast landscape of tools and libraries for keeping tabs on data changes, user activity, console use, and more. 

Evgeny Li   

[Backup Strategies for SQLite in Production](https://oldmoe.blog/2024/04/30/backup-strategies-for-sqlite-in-production/) — Not Ruby specific, but a fantastic primer to a topic that may begin to affect more Rubyists as the idea of running Rails apps on SQLite in production continues to take off. 

Mohammad A. Ali   

[Free eBook: Advanced Database Programming with Rails and Postgres](https://pganalyze.com/ebooks/advanced-database-programming-rails-postgres?utm_source=RubyWeeklySecondary05022024) — Learn about subqueries, materialized views, and custom data types in Postgres & Rails and follow along with our examples. 

pganalyze sponsor   

[Adding Your Ruby Gems to AWS CodeArtifact](https://aws.amazon.com/blogs/aws/add-your-ruby-gems-to-aws-codeartifact/) — Amazon Web Services is showing more love to Ruby by enabling the use of CodeArtfact as a private gem server. You can also set it up to pull gems from upstream sources (like rubygems․org) automatically so you can have your custom and public gems all on one server. 

Sébastien Stormacq (Amazon)   

[Rails, Assets, ActiveStorage and a CloudFront CDN](https://headey.net/rails-assets-active-storage-and-a-cloudfront-cdn) — How to configure your Ruby on Rails app to use Amazon CloudFront for assets as well as ActiveStorage / ActionText. 

Olly Headey   

📄 [AnyCable for Rails: How Does it Improve over Action Cable?](https://blog.appsignal.com/2024/05/01/anycable-for-ruby-on-rails-how-does-it-improve-over-action-cable.html) Abiodun Olowode 

📄 [Installing Older Ruby Versions on Ubuntu 24.04 and 22.04](https://deanpcmad.com/2024/installing-older-ruby-versions-on-ubuntu-24-04-and-22-04/) Dean Perry 

📄 [`ActiveRecord::Base#pluck` Adds Support for Hash Values in Rails 7.2](https://blog.saeloun.com/2024/04/26/rails-7-2-activerecord-pluck-to-accept-hash-values/) Nishant Samel 

📄 [Using Local Font Files in the Rails 7.1 Asset Pipeline](https://blog.theamazingrando.com/posts/rails-7-propshaft-fonts.html) Paul Sadauskas 

📄 [Rails to Enhance Its Log Output with an SQL Query Count](https://blog.saeloun.com/2024/04/24/add-queries-count/) Apoorv Tiwari 

📄 [Refactoring for Readability in Ruby: A Showcase](https://dev.to/vizvamitra/refactoring-for-readability-in-ruby-a-showcase-12m3) Dmitrii Krasnov  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/kpgcpg0mvcbbak721lls.jpg)](https://github.com/socketry/xrb)  

[XRB: Think ERB But Even More HTML-y](https://github.com/socketry/xrb) — XRB is a simple template engine for Ruby that boasts being 10-20x faster than ERB (not to be confused with Erubi/Erubis, though) with a simpler syntax that’s closer to plain HTML (and which also supports Ruby style `#{}` interpolation). 

Samuel Williams et al.   

[rbspy 0.20.0: A Sampling Profiler for Ruby](https://github.com/rbspy/rbspy) — Provides a way to profile a Ruby app even without having to restart it. v0.20.0 extends support to the latest Ruby versions, including 3.3.1. 

Evans, Jensen, et al.   

[Don't Risk Out of Date Ruby & Rails Versions](https://reinteractive.com/services-codecare-shield) — Get a free security assessment and discuss how our incremental upgrade service — CodeCare Shield — can improve the speed, security and stability of your app. 

reinteractive/CodeCare® Shield sponsor   

[Karafka 2.4: Advanced Kafka Processing for Ruby and Rails](https://mensfeld.pl/2024/04/karafka-2-4-release-announcement-advancing-kafka-processing-for-ruby-and-rails/) — A significant release for a powerful multi-threaded processing framework to use with the [Apache Kafka](https://kafka.apache.org/) event streaming system. [GitHub repo](https://github.com/karafka/karafka). 

Maciej Mensfeld   

💡 If you want to learn more about where you might use Kafka and Karafka, Brad Urani's talk [▶️ Event Streaming Patterns for Ruby Services](https://www.youtube.com/watch?v=RBj4S9S-fJI) and Guillermo Aguirre's [▶️ Applying Microservices Patterns to a Modular Monolith](https://www.youtube.com/watch?v=4zrQAJ0RlI4) may provide inspiration.  

[Measured 3.0: Encapsulate Measurements and Their Units](https://github.com/Shopify/measured) — A library from Shopify for storing, manipulating and converting weights, lengths, and volumes in different units. v3.0 adds Rails integration without needing a separate gem. 

Shopify   

[Rackula 1.4: Generate Static Sites from any Rack Middleware](https://github.com/socketry/rackula) — For turning a Rack-powered webapp into a static copy. 

Samuel Williams   

⚙️ [SidekiqJobController](https://github.com/circleco/sidekiq_job_controller) – Finer grained, immediate control over job processing. Circle   

- 🤖 [Ruby OpenAI 7.0](https://github.com/alexrudall/ruby-openai/releases/tag/v7.0.0) – Use OpenAI's APIs from Ruby. v7 also allows easier use of _local_ LLMs (such as via [Ollama](https://ollama.com/)), support for batches, and updates Assistants support.
- [Mongoid 9.0](https://github.com/mongodb/mongoid/releases/tag/v9.0.0) – Ruby ODM framework for MongoDB.
- [Doorkeeper 5.7](https://github.com/doorkeeper-gem/doorkeeper) – OAuth 2 provider for Rails / Grape.
- [ActiveHash 3.3](https://github.com/active-hash/active_hash) – Use a hash as a data source ActiveRecord style.
- [Shrine 3.6](https://github.com/shrinerb/shrine) – File attachment handling library.
- [Kamal 1.5.1](https://github.com/basecamp/kamal) – The container-based app deployer.
- [httparty 0.22](https://github.com/jnunemaker/httparty/releases/tag/v0.22.0) – The one and only.         

Curated by [Peter Cooper](https://twitter.com/cooperx86) and [Glenn Goodrich](https://twitter.com/ruprict).
Published by [Cooperpress](https://cooperpress.com/). 

[Change your email](https://rubyweekly.com/edit_subscription/*|UID|*) or [Stop getting this newsletter.](https://rubyweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom 

Other weekly newsletters we publish include [Postgres Weekly](https://postgresweekly.com/), [React Status](https://react.statuscode.com/), [Frontend Focus](https://frontendfoc.us/), and [JavaScript Weekly](https://javascriptweekly.com/).
