Short Ruby News - Edition #55
Discover the world of Ruby in this comprehensive newsletter covering week 31 of 2023. Find code samples, community updates, gems, resources, and thought-provoking discussions.
You can jump directly to a section:
๐ Our Community
๐ Events
๐ย All about Code and Ruby
๐งฐย Gems, Libraries, and Updates
๐คย Related (but not Ruby-specific)
More content: ๐ ๐ ๐ง ๐ฅ โ๐พ (articles, podcasts, videos, newsletters)
Looking for sponsors ๐ค
Friendly RB is a friendly Ruby conference, happening on 27-28 September in Bucharest, Romania. Tickets are already sold out! We are just looking for few more sponsors.
There are 6 spots available for Community Sponsorship at only $1250.
"We are looking for sponsors to partner with us in bringing a new and unique European conference. Sponsorship funds will go toward keeping ticket costs low, honorariums for conference speakers, and video recording"
If you think your company might want to sponsor this conference please write to adrian@adrianthedev.com.
๐ Our Community
๐ Ruby On Rails announced Introducing the Rails Luminary Awards: Nominations Now Open
This is about:
Do you know someone who has consistently gone above and beyond to help others, who has shaped discussions, answered countless questions, triaged bugs, added particularly helpful features, or introduced us all to innovative new ideas?
Nominate these exceptional individuals who you believe deserve to be recognized using the form below.
๐ Ian shared #helloworld_rb
๐ Events
๐ Lucas Barret announced they plan to launch a new podcast:
๐ Ogom shared Osaka RubyKaigi 03
๐ Juliana Dias announced that Tropical Ruby 2024 is back
๐ Friendly.Rb announced a new speaker "Let there be docs!" with Svyatoslav Kryukov - Friendly.rb - Your friendly European Ruby conference
๐ Avi Flombaum shared they are looking for a space for NYC on Rails | Meetup
๐ Ruby Conf Thailand shared Schedule | RubyConf TH 2023
๐ Euruko shared Euruko 2023 agenda:
๐ Ruby Conf announced their first speaker RubyConf Homepage
๐ All about Code and Ruby
๐ Yukihiro Matz shared about methods in Ruby:
Please consider upgrading to paid to support this newsletter and get an ad-free version.
Or if you have a product or service, book or event (even better if they are built with Ruby) that you want to promote in this newsletter consider choosing one of the sponsorship packages
๐ I shared a thread with some insights from Stack Overflow survey:
๐ Postmodern asked about error key for validating belongs_to:
And it seems that the response could be:
๐Nithin Bekal shared their article Ruby's bang methods - Handle with care! with a code sample:
๐ Takashi Kokubun shared about Ruby 3.3 YJIT improvements:
Takashi also shared a merged PR YJIT: Compile exception handlers:
๐ Donn Felker asked for recommendations of Sidekick config:
๐ Nick Bradley shared #diff method for Ruby Data classes
Victor Shepelev replied with another code sample:
๐ Thomas Countz shared a thread about closures in Ruby:
And he also shared how they used this in a gem:
๐ @Smithwebdev@Ruby.Social asked about how to start TDD:
Here are some of the replies:
๐ Prabin Poudel asked about using JSON type column in PSQL:
Here are some of the replies:
๐ Ruby Cademy shared how to configure Rails COnsole Prompt to show environment:
Here is a similar tip shared a while back by Matt:
๐ Rob Zolkos shared how to define a relation between users and teams:
Stephen Margheim proposed an improvement:
๐ Samuel Williams shared about the performance of sus test runner:
๐ Ruby Cademy shared about using Faker random to get the same results:
๐ Harrison Broadbent shared a tip about using y to print data in YAML format in Rails:
๐ Kevin Newton shared a tip about using Integer#anybits?
๐ Gavin Morrice asked about why create setters and getters instead of using ivars:
There is a good discussion there (read on nitter) about coding styles.
๐ Kevin Newton shared about redefining Integer#-@
๐ Kevin Newton shared about magic comments:
๐ Greg Navis shared a thread about Active Jobs callbacks:
๐ Jeremy Smith shared the code to create an Alternative approach to drag and drop sorting with acts_as_list
๐ Janko Marohniฤ asked about the approach to store session in DB and store session ID in cookie:
The replies are mostly pointing out either the limitation of 4KB or the security feature to be able to logout from all sessions:
๐งฐ Gems, Libraries, Tools and Updates
๐งฐ Rafael Franca announced the release of Rails 7.0.7. Read the full changelog here
๐งฐ Sinatra announced a new release of version 3.1 that has new features:
๐งฐ Avo announced that Avo 3 beta is now open โ Avo 3 Beta
๐งฐ Jeffrey Phillips Freeman announced their new gem called abstractify โ a gem to create abstract classes in Ruby:
๐งฐ Avi Flombaum shared a repo that has configuration for A simple TailwindCSS powered Github Pages Starter
๐งฐ Marco Roth announced the release of a new version for Stimulus โ Release v3.2.2 ยท hotwired/stimulus
๐งฐ Kevin Newton announced the first version of yarp gem
๐งฐ Benjaminwood shared a tip about upgrading RSpec Fix and_call_original for Ruby 3.2 by igor-drozdov ยท Pull Request #1552 ยท rspec/rspec-mocks
๐งฐ Yasuo Honda announced a release of a new version activerecord-oracle_enhanced
๐งฐ Jeremy Evans announced a new release of hanna-1.5.0 and hanna-nouveau 1.5.0 Released ยท jeremyevans hanna ยท Discussion #23
๐งฐ Stan Lo shared a merged PR for IRB about Drop showing indent level number in DEFAULT prompt and INF_RUBY prompt by tompng ยท Pull Request #679 ยท ruby/irb
๐ค Related (but not Ruby-specific)
๐ค Julian Rubisch shared a thread (read on nitter) with the result of a survey they did about Tech Debt. I added here only one of the data shared:
๐ค Justin Jackson shared how to block GPT bot to access your website OpenAI Platform
๐ค Gergely Orosz asked about how to think about moving to the manager path:
๐ค Adrian Oprea shared an advice about naming:
๐ค Julian Rubisch shared what does it mean to be a senior:
๐ค Maple Ong shared a tip about accessing the PR diff on Github:
๐ Naofumi Kagami ๅ ใ ็พ็ดๅฒ shared about TDD:
More content: ๐ ๐ ๐ง ๐ฅ โ๐พ
๐ Jason Charnes shared an update about Active Record Cookbook:
๐ Jason Swett asked for community help to meet people working at AI tech products:
๐ Joe Masilotti shared an update about their Turbo Native book:
๐ Newsletters
๐ Ruby Weekly published a new edition #666 - Sinatra 3.1 released
๐ Allison Pike published a new edition of Once a Maintainer about Brendon Muir โ โBuilding tools for primary schools in New Zealand using Railsโ
๐ Greg Molnar published a new edition of This Week in Rails: A new release, Action Mailer preview empty states, bugfixes and more!
๐ Ruby LibHunt published a new edition of the Issue 377 - Two Garbage Collection Improvements Made Our Storefronts 8% Faster
๐ Any Cable published a new edition about Any Cables Monthly #12
๐ง Podcasts
๐ง Remote Ruby published a new episode about Hackathon - Strada - Rails World
๐ง The Ruby on Rails Podcast published a new episode about Episode 482: Everything is Awe(ful)some! (Brittany + Brian)
๐ง The Bike Shed published a new episode about 396: Build vs. Buy
๐ง Rooftop Ruby published a new episode about 22: Abstraction Goes All the Way Down
๐ง Indie Rails published a new podcast about IndieRails | Nadia Odunayo - Building The StoryGraph
๐ง Maintainable Software Podcast published a new podcast about Ahmed Wasfy - Thriving as an Engineering Manager
๐ฝ๏ธ ๐ฅ Videos
๐ฝ๏ธ Avi Flombaum streamed during the weekend a series of videos about courseguide.ai - here is the planning session and here is the coding session
Screencasts
๐ฅ Yaroslav Shmarov published new videos about:
Tailwind on Rails #138 Responsive Layout with Sidebar and Navbar
Ruby on Rails #141 Responsive Content layout: Grid, Flex, Centered
๐ฅ Dean De Hartย published new videos about:
๐ฅ Nick Sutterer published a new video about How to nest operations in Trailblazer
๐ฅ Phil Smy published a new video about How To Integrate Chatgpt With Rails 7: Step-by-step Tutorial
๐ฅ David Kimura published a new episode about PDF Reader
๐ฅ Pete Hawkins published a new video about Building a ChatGPT bot using Ruby on Rails
๐ฅ Ruby Cademy published a new video about Redirect the Use of the JSON Library to Implement a Powerful Data Import pattern
๐ฅ Jeremy Smith published a new video about Alternative approach to drag and drop sorting with acts_as_list
โ๐พ Articles
Whatโs new
Avi Flombaum published the 4th part of their series about An ActiveStorage S3 Direct Uploader: Part 4 - Bonus Features โ โJust for fun, I thought we'd add a feature where after the upload is complete we display an audio player for the track that was just uploadedโ
Gowsik Vivekanandan published a new article about Rails 7.1 Store secret_key_base In Credentials For Local Environment โ โIn the latest stable version of Rails (Rails 7.0.6), secrets is used for storing the secret_key_base in the local environment. However, from Rails 7.1 onwards, secret_key_base will be moved to credentialsโ
Gift Egwuenu published a new article about July 2023 RubyGems Updates โ โAs part of our efforts at Ruby Central, we publish a recap of the work that weโve done the previous month. Read on to find out what updates were made to RubyGems and RubyGems.org in Julyโ
Alkesh Ghorpade published two new articles about whatโs new in Rails 7.1: Rails 7.1 adds the ability to raise errors on missing callback actions โ โRails 7.1 allows configuring the controllers to raise an error when a callback's only/except options have missing actionsโ and Rails 7.1 adds the ability to defer the unique constraints in PostgreSQL โ โRails 7.1 adds the ability to defer the unique constraints in PostgreSQL. You can use the add_unique_key command and pass the deferrable option to do this. The deferrable option can take two values: immediate and deferredโ
Jorge Manrubia published a new article about Difficult and complex โ โBeing able to run a marathon is very difficult. But what you have to do to prepare is simple. A small sheet of paper is enough to describe the steps. You will need tremendous effort and discipline - so itโs hard - but it is simpleโ
I wrote an article about Insights from Stack Overflow Developer Survey 2023 about Ruby where I share key takeaways about Ruby from the 2023 Stack Overflow Developer Survey.
Kartikey Tanna publish an article about Understanding the Role of the `schema.rb` File in Rails Development โ โI've recently had a thought-provoking discussion on LinkedIn Ruby on Rails group about the role of the schema.rb file in Rails development, particularly concerning its authority over the database schema. The conversation evoked mixed reviews, and I thought it might be interesting to bring the topic to dev.to and get more insightsโ
Deep Dives
Peter Zhu published a deep dive about Two Garbage Collection Improvements Made Our Storefronts 8% Faster โ โwe found two improvements in Rubyโs garbage collector that improved the average garbage collector performance by 46%, which translated to a decrease in average response time by 8% and 99th percentile response time by 25%โ
Akshay Khot published two articles this week: One about Using Zeitwerk Outside Rails โ โThis article shows how to use the Zeitwerk gem to autoload classes and modules in a Ruby app that's not using Rails. We'll also learn how Rails configures Zeitwerk internally and introduce the concept of models in our no-rails Ruby web applicationโ and another one about How to Implement Content Security Policy in Rails โ โThis article shows how to implement content security policy in your Rails applications to protect against cross-site scripting (XSS) vulnerabilityโ
Jeremy Friesen published an article about Skipping Your Parent to Go to Your Grandparent: Leveraging Ruby's super_method Method โ โKnowing when to break the rules is useful. Explaining why youโre breaking them is crucial. And adding guide/guard rails to help ensure that the assumptions you had when breaking the rules are still in playโ
Haseeb A published an article about SQL injection in Rails - Learn from an attackerโs shoes โ โThis guide will guide you through the intricacies of SQL injection in Rails applications, helping you understand the vulnerability itself and how to prevent such a disastrous scenarioโ
Evgeniy Demin published a new article about Breaking change during Rails upgrade introduced by David Heinemeier Hansson โ โI have noticed one strange behavior about how Rails serves static files. It looks like a breaking change because Iโm upgrading Rails 5.2 to 6.1. After spending some time debugging it, I decided to share this short story with youโ
How-Tos
Mike Coutermarsh published an article about How to stop Rails from setting a session cookie โ โRecently I was working on a Rails API and I wanted to stop Rails from setting it's _session cookie for API requestsโ
Harrison Broadbent published an article about Preview emails in Rails with letter_opener, MailCatcher and MailHog โ โIn this article, I'm going to share everything I've learned about email previewing in Rails, and I'm going to show you how to quickly preview emails in your Ruby on Rails apps, using each of these methods (mailer previews, letter_opener, MailCatcher and MailHog)โ
Barry Hess published an article about TIL: Rails has_one Nested Attributes Tweaking โ โIn a project I'm working on right now I've been using a Rails nested form and a couple of things caught me off guardโ
Nithin Bekal published a new article about Ruby's bang methods - Handle with care! โ โIn Ruby, method names can be suffixed with !. These are often called โbangโ methods. This is used to indicate that it is a dangerous counterpart of the non-bang version of the method.I had always thought of โdangerousโ to mean that the method mutates the underlying object and returns that object. However, these methods can differ from their non-bang versions in other subtle ways, which surprised me recentlyโ
Matt Brictson published a new article about Safe redirects in Railsย 7 โ โEnforcing canonical URLs by redirecting to params is not safe and may raise an exception. Use strong params with allow_other_host: false for security.โ
Raghu Varma Bhupatiraju published an article about Implementing materialized views in Rails โ โWhen you have a complex query which takes a lot of time to execute and you want to render the data in a page which will be accessed frequently materialized view is your best optionโ
Joรซl Quenneville published an article about Structuring Conditionals in a Wizard โ โIโve worked on several projects, both Rails and Elm, where the wizard code had gotten so convoluted that the team were scared to work with it. Applying the refactors shown below had a major impact and allowed everyone to feel confident when dealing with this part of the systemโ
Tobias L. Maier published an article about Simplifying UI Testing with data-testid in RSpec & Capybara โ โThis blog post explains how to use Test IDs with RSpec and Capybara, and introduces two new RSpec matchers (have_test_id and have_test_id_and_css) to simplify UI testingโ
Lucas Barret published a new article about Padle is nice but squash (Rails migration) is funnier โ โThis is the time and place to learn about migration and try to squash someโ
Konrad Badzioch published a new article about Setting up Hanami and Postgres with Docker Compose โ showing how to create a Docker image for Hanami
Juraj Kostolanskรฝ published a new article about Dark mode using TailwindCSS and Turbo โ โThe CSS framework Iโm using to style LocaleData - TailwindCSS - has a great built-in support for dark mode. It provides a dark variant that lets you style your site differently when dark mode is enabledโ
Adrian Valenzuela published a new article about Creating a Ruby Method | Mugen Ruby โ โWe are going to create a method that reverses a stringโฆready? Letโs goโ
Carlos Castaneda published a new article about TIL Blog - Mini Project โ โFor my mini project I decided to take my love of movies and build a movie search appโ
Related
Adam Rice published a new article about Thriving in economic uncertainty โ โLaying off staff is tough, and it happens due to factors that force management to refocus on efficiency. The challenge, however, is to keep these pressures from eclipsing the importance of maintaining healthy, aligned, and efficient teamsโ
Ferdia Kenny published an article about Tips for working across timezones โ โFor about a month though I was working with folks based in UTC -4 which meant I came online about 5 hours before my colleagues. This was challenging. However, I found the following tips helped a lotโ
I published an article about Bugs, errors and causes from an 1975 paper โ โIn this article, I share Albert Endres' findings and explore how understanding the problem, effective communication, and domain knowledge play crucial roles in reducing errorsโ
Julia Evans published an article about Some tactics for writing in public โ โI want to explain some tactics I use to try to make the comments on my posts more informative and useful to me, and to try to minimize the number of annoying comments I getโ
James Garcia published a new article about My experience with the Agency of Learning โ โA couple of months ago I was honored to be accepted to join Agency of Learning. Now that I have had some time in the program I wanted to share my experience. Also, hopefully to bring some awareness to the programโ
Please consider becoming a paid subscriber to support this newsletter for just $1.5/week ($6.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.