Short Ruby Newsletter - edition 109

The one with Ruby 3.4.0-preview2 launch, videos from Rails World published, Xavier explaining how Zeitwerk and namespacing work and inspiring Ruby code samples

In partnership with

Table of Contents

Streamline your development process with Pinata’s easy File API

  • Easy file uploads and retrieval in minutes

  • No complex setup or infrastructure needed

  • Focus on building, not configurations

🚀 Launches and discounts

🚀 Andy Croll launched usingrails.com - a directory to gather all organisations that are using Ruby on Rails:

Submit your company at https://usingrails.com

After creating a new account, you can submit a website directly via the web interface at https://usingrails.com/submissions/new.

Source: @coolprobn

Source: @GregMolnar

📅 Events

📅 One month away until RubyConf 2024 if you plan to go now it is a good time to buy ticket and plan your trip:

📅 Tropical.Rb tickets will go on sale on October 30th, 2024! Don’t miss out and get ready to hit F5!

📅 Ruby Banitsa conf will be hosted on December 7th, 2024 in Sofia, Bulgaria with Kasper Timm Hansen as their international guest.

📅 Here is a list of Meetups happening this week (source: rubyconferences.org/meetups)

👉 All about Code and Ruby

👉 ️Yui Naruse shared a new release of Ruby - 3.4.0.preview2

️💻 Xavier Noria shared a long post about the new version of Zeitwerk explaining how it works. Here is just the first part of the post, but you should read it full.

He later added:

Source: @fxn

💻 Code Samples

💻 Saeloun shared Rails’s ability to ignore counter cache columns while they are backfilling

️💻 ️Kyrylo Silin shares how importmap can check dependencies for vulnerabilities

💻 ️ Jorge Manrubia shared why loading Rails fixtures as part of seeding is a great idea!

️💻 Deepak Mahakale shared the new addition on rails 8 that helps you drop multiple tables with a single command

💻 Ruby Cademy shared Rails’s new added support for using hashes in select

Also, this is how you can take advantage of the rails runner command and Bash Heredocs

💻 ️Michael Chaney highlights the flexibility of Rails in handling attribute normalization

He also shared the following on query building:

💻 Prabin Poudel shared a code sample to implement copy to clipboard feature with StimulusJS and TailwindCSS/DaisyUI

️💻 Emmanuel Hayford shared about using the allow_browser:

Source: tompng

️💻 Ruby Cademy shared a code sample showing how to use extend on the same line:

Source: @RubyCademy

They shared some examples from MailCatcher or Capnp integration:

Source: @RubyCademy

️💻 Gregory Brown shared about how to read code:

️💻 David Alejandro reminded us that Turbo Mount can help with quickly using React/Vue/Svelte components with Hotwire:

️💻 Igor Alexandrov shared how to get the Ruby version in Kamal from .ruby-version file

And you can then use it in the Dockerfile:

# Assuming we're inside the original current_user method
# Get the current method object
current_
method = method(__method__)

# Define the new method
new_method = proc do |*args|
  puts "Entering modified current_user method"
  result = current_method.call(*args)
  puts "current_user result: #{result. inspect}"
  # debugger
  result
end
# Replace the method
self.class.send :define_method,__method__, new_method)
self.class.send :define_method, "old_#{__method__}", current _method)

# Restore the old method
old_method = method ("old_#{__method__}")
self.class.send(:define_method,__method__, old_method)
self.class.send(:undef_method, "old_#{__method

# Call the new method to continue execution
new_method.call

Source: @alazycoder2

📐 Thinking about Code Design

️📐 David Heinemeier Hansson shared about caching and no build strategy:

Source: @dhh

Jean Boussier explained why the results are the way they look like:

Source: @_byroot (Read on Threadreader)

️📐️ Steven R. Baker discusses on how Minitest is prefered over Rspec for its simplicity and portability

️📐 John Pollard asked about refactoring variables set in a view: ️

Here are some replies:

Source: @robzolkos

Source: @marcoroth_

Source: @RailsQuest

Source: @tomrossi7

Source: @rebootxapp

📐 David Backeus shared about performance for Rails + ActiveRecord:

Source: @dbackeus

Source: @dbackeus

📐 Mika Henriksson asked about using kamal-proxy with more than one server:

Source: @mhenrixon

Here are some replies:

Source: @GregMolnar

Source: @strzibnyj

️📐 Kacper Madej asked about using React with Ruby on Rails:

Source: @madejejej

Here are some replies:

Source: @adrienpoly

Source: @geetfun

Source: @ikristoph

Source: @Abe9000000

Source: @ehayes

Source: @geetfun

📐 Christopher Winslett shared about setting up data relationships in Ruby on Rails and Postgres:

Source: @winsletts

️📐 Kasper Timm Hansen shared a quote from Julian Rubisch newsletter about “Time spent riffling on your domain model or application architecture is time well spent”

Source: @kaspth

️📐 Nate Berkopec shared about being a Ruby performance team:

️📐 Yaroslav Shmarov shared they upgraded a Rails app from version 5 to Rails 7.2:

Source: @yarotheslav

💡Around code (news, findings, books, and more - all about Ruby)

💡 It was quite a big discussion last week on Hacker News about a submission for this article from AppSignal

💡 Ryan Bates shared a git tip to amend an earlier commit

💡 Miguel Michelson shared about using Kamal2 with Hetzner server:

Source: @michelson

️On the same topic Sam Saffron shared about tests being more reliable:

Source: @samsaffron

And on the same topic Lázaro Nixon shared about deploying on Kamal 2 with nobuild:

Source: @lazaronixon

💡 Brian Casel asked about who is building with Rails and if you want to improve your timeline you can see a lot of people in the replies:

Source: @CasJam

❤️ Why Choose Ruby and Rails

❤️ David Heinemeier Hansson shared about what makes Ruby special:

Source: @dhh

❤️ Viktor Schmidt shared about discovering Ruby and Ruby on Rails:

❤️ Xaden Ryan is reflecting on their return to Ruby after spending a decade working with other languages and is amazed at how extendable RoR is.

❤️ Christopher Winslett emphasises on the ROR’s “no-build” implementation that makes new machine setup a cinch

❤️ Emmanuel Hayford shared

Source: @siaw23

🧰 Gems, Libraries, Tools and Updates

🆕 New Gems and Repos

🆕 Kamil Nicieja announced the release of lammy - an LLM library for Ruby

Source: @kamil

🆕 Paweł Strzałkowski open sourced the repo for RubyEurope

Source: @koddsson

🧰 Updates

🧰 Kevin Newton announced a new version of Release v1.2.0 · ruby/prism

Source: @kddnewton

Source: @bradgessler

Source: @lazaronixon

🧰 Donal McBreen announced a new version of Kamal 2 - v2.2.0

Source: @hopsoft

🧰 Alex Rudall announced a new version of Release v7.2.0 · alexrudall/ruby-openai

Source: @strzibnyj

🤝 Jeffrey Emanuel asks what are the most important things people should keep in mind while interacting with LLM-based systems like ChatGPT

🤝 Mehrdad Farajtabar shared a paper about LLMs and Mathematical Reasoning:

Source: @MFarajtabar (read the thread on Threadreader)

🤝 Travis Hubbard talks about being a senior developer:

🤝 Felix Geisendörfer shares a git pro tip:

🤝 Yurii Rashkovskii shared about DRYing table definitions in Postgres:

Source: @yrashk

🤝 Andrew Atkinson shared about being a competent developer:

Source: @andatki

🤝 Nick Schwaderer shared about receiving feedback:

Source: @schwad_rb

More content: 📚 🗞 🎧 🎥 ✍🏾

📚 Sajjad Umar has released his new book "Ruby on Rails for Agile Web Development"

🗞 Newsletters

🗞 Hotwire Weekly published a new edition about Week 41 - Celebrating 1 Year of Hotwire Weekly!

🗞 Ruby On Rails published a new edition about Ruby on Rails - Lazy i18n watcher on boot and more

🗞 Ruby Weekly published a new edition about Ruby 3.4 (preview 2) gets a new parser

🗞 Ruby Libhunt published a new edition about Issue 438 - What's New in Ruby on Rails 8

🎧 Podcasts

🎧 Flagrant ® published a new podcast about All Those Letters That You Do | Flagrant

🎧 Ode To Rails Conf published a new podcast about Stephanie Minn

🎧 Code And The Coding Coders Who Code It published a new podcast about John Nunemaker

🎧 Indie Rails published a new podcast about IndieRails | Rails World 2024 Crossover

🎧 The Rails Changelog published a new podcast about The Rails Changelog | 026: Exploring Rails' Default Debugger with Stan Lo

🎧 Changelog published a new podcast about The Moneyball approach

🎧 Joshua Wood published a new podcast about FounderQuest | Acquiring Fireside with John Nunemaker

🎧 Remote Ruby published a new podcast about Rails World and SellRepo

🎧 The Ruby on Rails Podcast published a new podcast about Episode 525: Catching Up With Ruby Central with Marty Haught

🎧 The Bike Shed published a new podcast about 443: Rails World and Open Source with Stefanni Brasil

📽️ 🎥 Videos

🎥 Ruby On Rails published the talks from the conference: Rails World 2024

🎥 Jason Swett published a new video about Giving Cursor Another Try (It's Better Now)

🎥Graceful.Dev published a new video about Inline Rescue

🎥 Sahil Lavingia and Tony Ennis published a new video about Coding with Cursor: Rails vs Next Session 1

🎥 #Posette Conf published a new video about SaaS on Rails on PostgreSQL with Andrew Atkinson

🎥 Jeremy Smith published a new video about Building Liminal (see it on Threadreader)

✍🏾 Articles

What’s new 🆕

🆕Jon Sully published an article about How CDNs Work (Propshaft / Static Assets Pt. 2)

🆕 Stanislav Katkov published a new article about Battling N+1 queries in Rails

🆕 Damilola Olatunji published an article about published an article about What’s New in Ruby on Rails 8

🆕 Greg Navis published a new article about Rails on OpenBSD: Motivation and Architecture

🆕 Prasanth Chaduvula published an article about Rails 7.1 Supports Multiple Preview Paths For Mailers

🆕 David Copeland published an article about A Simple Explanation of Postgres' <code>Timestamp with Time Zone</code>

🆕 Greg Molnar published an article about Upgrading to Kamal 2

🆕 Jeffery Morhous published an article about How Solid Queue works under the hood

🆕 Philippe Creux published an article about Building a Robust Data Synchronization Framework with Rails

🆕 Akshay Khot published an article about Not-Null Shortcut in Rails 8 Migration Generator

How-TOs 📝

📝 Tejas Bubane published an article about Redis pipelines to the rescue

📝 Rails Designer published an article about Smooth Transitions with Turbo Streams | Rails Designer

Ben Dicken published a new article about B-trees and database indexes

Scott Chacon published a new article about Why GitHub Actually Won

Reply

or to participate.