

Discover more from Short Ruby Newsletter
Short Ruby News - Edition #65
Discover the world of Ruby in this comprehensive newsletter covering week 43 of 2023. Find code samples, community updates, gems, resources, and thought-provoking discussions.
Consider becoming a paid subscriber to support this newsletter for just $1.8/week ($7.5/month), and you will receive an ad-free version. Your contribution aids growth and maintains the quality of ShortRuby for everybody
You can jump directly to a section:
๐ New Products & ๐ Events
๐ย All about Code and Ruby
๐งฐย Gems, Libraries, and Updates
๐ค Related (but not Ruby-specific)
More content: ๐ ๐ ๐ง ๐ฅ โ๐พ (articles, podcasts, videos, newsletters)
๐ New Products
๐ย David Heinemeier Hanssonย announced Skiff. See the video on twitterย or onย nitter:
๐ Jared Whiteย launched his new courseย ย Building Courseware I Can Understand: The Launch of CSS Nouveau

๐ Events
๐ Andrew Atkinsonย sharedย that 2024 Southeast Ruby in Memphis, TN is back:
๐ Robb Shecter announced they are starting the Denver meetup again and asked us to fill in the survey about day and time and join the meetup

๐ All about Code and Ruby
๐ย Maxime Chevalierย sharedย their paper about YJIT: a basic block versioning JIT compiler for CRuby is published
๐ Kerri Miller (Parody)ย asked about the difference between let and subject in RSpec:

Here are some of the answers





๐ย Deepak Mahakaleย sharedย about using find_each over all when expecting a large dataset:

๐ Jan Dudulskiย asked about strategies to handle JSON payloads:

Here are some of the possible ways to achieve the same:



๐ย Janko Marohniฤย askedย about how to differentiate between default value from DB and user input:

Ariel Juodziukynasย proposed the solution:

๐ย Bhumiย sharedย about Ruby keywords:

๐ย Naofumi Kagami sharedย about why not have fat controllers:
๐ย Dr Nic Williamsย sharedย about RBS boolish:
See the section here:
๐ย Simon Chiuย sharedย about their gem geetfun/deployed
๐ย Robby Russellย sharedย about Rails being the Radiohead of software ย read it full atย Rails In 2024: Still Relevant Or Living In the Past

If you want to read other people reactions here are some places where this was posted: r/ruby (22 comments), r/programming (339 comments)
๐ย Yaroslav Shmarovย sharedย a code sample showing the email regexp validator from Ruby:

๐ย Alessandro Rodiย showed that when retrying it is important to be aware of caching:
๐ย Josh Pigfordย asked about the simplest way to render a boolean toggle:

Matt Swansonย replied:
๐ย Panosย sharedย an IRB easter egg:

Support ShortRuby by subscribing for only $7.5/month ($1.8/week).
Get an ad-free experience and help us maintain our quality for everyone.
๐ Kevin Glowaczย sharedย how they managed to run Ruby 3.2 on Elastic Beanstalk:

๐ย Julian Rubischย shared a newย Challenge 14: Stimulus - KeyboardEvent 101 | The Hotwire Club

๐ย Emmanuel Hayfordย sharedย a tip about changing the DB in Rails:
๐ย Andrea Roccaย shared they usedย turbo_boost-commands: Commands to help you build robust reactive applications with Rails & Hotwire
๐ย Chris Oliverย sharedย a Ruby tip about choosing to define methods instead of method_missing:
๐ย Maxim Gurinย sharedย a security tip about doing symbol to string coercion:

๐ย Joel Mossย sharedย about how using Stimulus and Turbo cut the JS lines of code:
๐ย Vladimir Dementyevย sharedย a slide they work on about advantages of profiling tests:

Here are some answers:

๐ย Nate Hopkinsย sharedย a trick for debugging deep app internals:
๐ย Joe Masilottiย sharedย a code sample of handling authentication when working with Turbo Native:

๐ย Kevin Newtonย shared that Prism supportsย JavaScript

๐ย Dhaval Singhย asked about the order of the after_commit hooks are run:

Petrik De Heusย answered and provided a link to a PR about after_commit
ย callbacks run in the wrong orderย
๐ย Matt Swansonย sharedย about adding extra checks in development to catch bugs:
๐ย Bhumiย sharedย about & in Ruby:

๐ย Yaroslav Shmarovย shared about using Postgres for Action Cableย (see Action Cable Guides) and he also shared there are some limitations - read this

๐ย John Nunemakerย sharedย about using net_http_timeout_errors: Provides a list of Net::HTTP timeout errors

๐ย Matt Swansonย sharedย a code sample about writing a test instead of a TODO to remember what to remove when upgrading:
๐ย Santanu Bhattacharyaย sharedย about using yard stats to show undocumented objects:

๐ย Iย asked about email service with generous free tier:

Here are some of the replies: Postmark, Brevo, AWS SES, SendGrid, Qui, MailPace, Resend, MailerSend, MailGun, MailJet,
๐ย Yusuke Endohย sharedย a slide about TracePointใๆดป็จใใฆใขใใซๅๅคๆดใฎ่ฒ ๅต่งฃๆถใใใ่ฉฑ
๐ย Georgie Boyย sharedย some performance stats for using Phlex Components:

๐ /u/okizeme asked about salaries for Rails developers and received almost 100 responses:

๐ u/just-for-throwaway asked about the idiomatic way to handle validations (click to read their entire post as it includes more information that what I added here):

Please consider becoming a paid subscriber to support this newsletter for just $1.8/week ($7.5/month), and you will receive an ad-free version. Your contribution aids growth and maintains the quality of ShortRuby for everybody
๐งฐ Gems, Libraries, Tools and Updates
๐ ๐งฐ Dr Nic Williams announced a new gem searchcraft - Instant Search for Rails and ActiveRecord using SQL materialized views
๐ ๐งฐย Joel Mossย announced a new gemย inspectacular: Custom inspection for your Ruby objects
๐ ๐งฐย Vladimir Dementyevย announced a new gem imgproxy/imgproxy-rails
๐ ๐งฐย Chad Wilkenย announced a new gemย chadwilken/tiptap-ruby: A library that allows you to generate, parse, and render TipTap documents in Ruby
๐ ๐งฐย Juliรกn Pinzรณnย announced a new gem called actionview_attribute_builders
๐งฐ Jake Zimmermanย announced a new version of Sorbet that now supportsย ย Methods with Overloaded Signatures ยท Sorbet

๐งฐ Alexander Adamย sharedย a gemcrimson-knight/fruit_juice: A simple gem for triggering background jobs in Ruby into Crystal for the Mosquito background processor
๐งฐย Avoย sharedย an update for Avo 2 and Avo 3
๐งฐ Glauco Custรณdio announced a new release for tanakai - Tanakai is a modern web scraping framework written in Ruby. A fork of Kimurai
๐งฐย Jeremy Evansย sharedย Rodauth 2.32.0 Released ยท jeremyevans rodauth ยท Discussion #371
๐งฐย Gert Jan Peetersย announced they made stimulus-lsp work on neovimย feat: add stimulus-language-server support by Gert-JanPeeters ยท Pull Request #2870 ยท neovim/nvim-lspconfig
๐ ๐งฐย Faraaz Ahmadย announced a new gemย tainted: Taint checking for Ruby using data-flow analysis
๐งฐย Nate Hopkinsย announced a draft PR for UniversalID gem - Update serialization to use MessagePack
ย ๐งฐย Dr Nic Williamsย sharedย an announcement from Heroku that pgvector now generally available for Heroku Postgres | Heroku Dev Center
๐งฐย Benjamรญn Silva H.ย talked aboutย chaskiq/plain - Plain is a Rails engine that serves as an Artificial Intelligence (AI) assistant for your Rails project

๐งฐย Koichi Itoย announced a new release of Rubocop Rails โย Release RuboCop Rails 2.22.0 ยท rubocop/rubocop-rails
๐งฐย Hiroshi Shibataย announced a newย Release v13.1.0 ยท ruby/rake. The release changelog is big but here is just a part of it:
๐งฐย Alex Rudallย sharedย an update for alexrudall/superagi: OpenAI API + Ruby
๐ค Related (but not Ruby-specific)
๐คย Jonathan H. Wageย sharedย performance improvements after using pgbouncer:
๐คย ย Una Kravetsย shared that adding a simple <hr>
in between options willย make an horizontal rule โ Select element: now with horizontal rules
๐คย Jeffrey Wayย sharedย that MacOS Safari added a new feature to see a website in iOS Simulator:

๐คย Robby Russellย asked a question that I think we should ask ourselves everyweek:

ย ๐คย Jason Swettย sharedย that code is also a tool for thinking and exploration:"

๐คย Nate Hopkinsย sharedย that taking time to identify the right primitives and good names will pay in the long run:
๐คย Matt Johansenย sharedย a thread about Okta being hacked:
More content: ๐ ๐ ๐ง ๐ฅ โ๐พ
๐ Newsletters
๐ Vipul A Mย published a new edition of This Week in Rails aboutย Reduce Memory Used By Active Support/Callbacks, Non Column Backed Attributes For Enum And More!
๐ Ruby Weeklyย published a new edition about How memoization can bend Ruby out of shape
๐ Awesome Ruby Newsletterย published a new edition Awesome Ruby Newsletter Issue 388 - Performance impact of the memoization idiom on modern Ruby
๐ Sara Jacksonย published a new edition aboutย This Week In Open Source (October 13, 2023)
๐ Greg Molnarย published a new edition of Rails Tricks aboutย Ruby On Rails Password Validation
๐ย Harrison Broadbentย published a new edition ofย The RailsNotes Newsletter ISSUE #16
๐ Ruby Radar published a new edition about Ruby AST In The Browser
๐ Hotwire Weekly published a new edition about Week 43 Stimulus LSP Goes Beyond VSCode And Ruby
๐ง Podcasts
๐งย Remote Ruby published a new episode aboutย Dhh On Rails World 2023 Rails 7.1
๐ง The Ruby on Rails Podcastย published an article aboutย The Ruby On Rails Podcast Episode 493: Rails World Live! Pt.1 With Nick Schwaderer And Andrew Mason
๐ง Rooftop Ruby Podcast published a new episode about p29: Ruby Centralโs Adarsh Pandit And Allison Mc Millan
๐ง Life on Mars published an article aboutย 73 From Rails To Revenue, With Khash Sajadi (Ceo & Co Founder @ Cloud 66)
๐งย Jason Swettย published a new podcast aboutย 200 - Saron Yitbarek, Founder of CodeNewbie and RubyConf Keynote Speaker
๐งย Ruby For Allย published a new podcast aboutย Microservices, Mayhem, and Main Branches | Episode 49
๐ฝ๏ธ ๐ฅ Videos
๐๏ธ Conference Talks
๐๏ธย Confreaks, Llcย published the videos fromย Rocky Mountain Ruby 2023
Screencasts
๐ฅย The Rubber Duck Dev Showย published a new video aboutย Stack Overflow vs ChatGPT
๐ฅย Jason Swettย published a new podcast aboutย Building a Search Engine Part 1 (Adding a Layer of Abstraction)
๐ฅย Yaroslav Shmarovย published a new video aboutย Rails #147 DataTables - search, sort, pagination with Ransack and Pagy
๐ฅย Cezar Halmageanย published a new video aboutย Build a SaaS with Ruby on Rails 7 - UTM URL Builder
๐ฅย Dean DeHart published a series of videos:
๐ฅ Dave Kimuraย published a new episode aboutย ย Episode 425 - Kamal in GitHub Actions and aboutย Using Ansible to Update Kamal Servers
๐ฅย Steven R. Bakerย published a new video aboutย The Shitshow 3 (with special guest!): Build a Multiplayer Game in Ruby on Rails 7.1
๐ฅย Thoughtbotย published a new video aboutย Rails Development LIVE
โ๐พ Articles
Whatโs new ๐
Jean Boussier published an article aboutย Performance Impact Of The Memoization Idiom On Modern Rubyย โ โOne major internal change in Ruby 3.2 was the introduction of object shapes. In this post, weโll try to cover why they were introduced, how they work, and what their limitations areโ and he also published an article aboutย Effects Of Pitchfork Reforking On Shopifyโs Monolith
Jorge Manrubia published an article aboutย Exploring Server Side Diffing In Turboย โ โWe did a lot of exploratory work before coming up with the Turbo improvement we presented in Rails World. One of those experiments included diffing in the server instead of in the clientโ
Akshay Khotย published an article aboutย Akshayโs Blog Is Now Write Software, Wellย โ โAfter two years and hundreds of thousands of readers, the blog has outgrown my personal domain and needs a new home. Welcome to ยซWrite Software, Wellยปโ
Patrick Helm published an article aboutย My Love Letter To Rails (And Ruby)ย โ โHere's why Ruby on Rails is far from being dead... Honeypot developers are even writing love letters to Railsโ
Greg Molnarย published an article aboutย Rails Authentication For Complianceย โ โSuppose you are working on a Rails application that needs to meet specific security compliance requirements like PCI, ISO 27001, or SOC2. In that case, one of the objectives is to have proper authentication and access controlโ
Alkesh Ghorpadeย published an article aboutย Rails 7.1 Raises An Error On Generating Model Attributes With Dangerous Nameย โ โRails 7.1 raises error on generating model attributes with dangerous name. The feature will raise an error if you specify any dangerous attribute when generating a migrationโ and another article about Rails 7.1 Adds Validation To Enums
Apoorv Tiwari published an article aboutย Limiting Maximum Index Name Length In Ruby On Rails 7.1ย โ โWith the introduction of Rails 7.1, a new 62 byte limit has been specified. If the index name exceeds this limit, it will fallback to a short format, along with a hash that ensures uniquenessโ
Vladimir Dementyev published an article aboutย The Future Of Full Stack Rails Ii: Turbo View Transitionsย โ โIn the previous post, we introduced the Turbo Music Drive application and enhanced it with DOM morphing techniques to provide a smoother UX. Now, weโll take it to the next level and add slick animationsโ
Brad Gesslerย published a new article aboutย Rails Background Jobs with Fly Machines โ โFly Machines can boot a VM in 500ms, run a Rails background job, then turn off when itโs done. That means you donโt have to pay for a server to sit idle if thereโs no jobs to process and you can have a much more scalable pool of on-demand workers when your application starts to get busyโ
Deep Dives ๐
Victor Shepelevย published an article aboutย โUseless Ruby Sugarโ: Pattern Matching (Pt. 2)ย โ โWith all the good things that Iโve said in the previous article about chosen pattern syntax looking natural, it still stands as a separate syntactic area of the code. This is mostly unusual for Ruby, which, once you get to know it closer, is characterized by a uniformity of semanticsโ
Noel Rappinย published an article aboutย Better Know A Ruby Thing #2: Constants โ Noel Rappin Writes Hereย โ โToday: constants. They arenโt actually constant. They arenโt only used for small strings or magic literals. They arenโt even mostly used for that in most Ruby programs. Constants are one of the core pieces of Ruby and they arenโt super-well documented in the official siteโ
Paweล Strzaลkowski published an article aboutย Tetris On Railsย โ โThe story behind Tetris on Railsโ
How-Tos ๐
Harrison Broadbentย published an article aboutย Action Mailer Attachments In Ruby On Railsย โ โActionMailer makes it easy to attach files to your emails. In this article, I show you how to attach single or multiple files, set custom encodings and mime_types, and attach images as inline attachments to display in your email bodyโ and an article aboutย Action Mailer Cc And Bcc Multiple Recipients
Sam Rubyย published an article aboutย Accommodating Safari Usersย โ โWhen you generate a new Rails app, you are given a choice whether or not you want JavaScript support or to include a CSS framework. The default is to use import maps. What isnโt clear at this time is that there is no documented upgrade path should you change your mind later. In fact, upgrading is difficult as support for things like Turbo, Stimulus, Action Cable and Action Text further lock you into this choiceโ
Stefan Wienertย published an article aboutย Rails 7.1 Migrate from secrets.yml to credentials.enc.ymlย โ โIf you have been using the Rails.application.secrets feature, you have been able to ignore the deprecation until Rails 7.1. But now, Secrets is gone! We had been using config/secrets.yml in the past because our deployment script would just replace the file during deploymentโ
Jeffery Morhous published an article aboutย Factory Bot For Rails Testingย โ โDive into FactoryBot to ensure your testing data is reliable and consistentโ
Akshay Khotย published an article aboutย Base64 Encoding, Explainedย โ โThis article covers the basics of Base64 encoding, including what it is, how it works and why it's important. It also shows how to encode and decode Base64 data in various programming languagesโ
Gelsey Torres published an article aboutย How Action Dispatch/Response#Content Type Changed Between Rails 5.2 To 6.1ย โ โWhat happened with ActionDispatch::Response#content_type between Rails 5.2 to 6.1? In this article, we will go into some background to learn what this method does, look at the differences in ActionDispatch::Response#content_typeโs return value between the several Rails versions, and how you can fix the problem if you come across it in your codebaseโ
I published an article aboutย How To Skip All Callbacks For All Models In Railsย โ โDifferent approaches for avoiding all callbacks on a Rails Active Record modelโ
James Garciaย published a new article aboutย Binged Watched (almost) a Rails Upgrade โ โI watched Chad Pytel and other developers from thoughtbot Upgrading a Rails 3.2 app to Rails 7. Be warned it 17 hours over several videos, but it was well worth the time invested. ๐ I wanted to share some things that I learnedโ
Please consider becoming a paid subscriber to support this newsletter for just $1.8/week ($7.5/month), and you will receive an ad-free version. Your contribution aids growth and maintains the quality of ShortRuby for everybody:
If you consider upgrading and want more information, please read Why to subscribe to paid.