Short Ruby Newsletter

Share this post

Short Ruby News - Edition #58

newsletter.shortruby.com

Discover more from Short Ruby Newsletter

A Monday summary of the articles, discussions, and news from the Ruby community
Over 3,000 subscribers
Continue reading
Sign in

Short Ruby News - Edition #58

Discover the world of Ruby in this comprehensive newsletter covering week 35 and part of week 35 of 2023. Find code samples, community updates, gems, resources, and thought-provoking discussions.

Lucian Ghinda (from ShortRuby)
Sep 11, 2023
2
Share this post

Short Ruby News - Edition #58

newsletter.shortruby.com
Share

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)

If you want to support this newsletter, one way is to choose to upgrade to paid, and another way is to talk with your company to sponsor it

πŸš€ New Products

πŸš€ Kasper Timm Hansen launched a service called Idiomatic Rails for your app

Source: @kaspth (read on nitter)

πŸš€ Igor Alexandrov announced the launch of One Tribe – HR And Leave Management System

Source: @igor_alexandrov (read on nitter)

πŸš€ PaweΕ‚ StrzaΕ‚kowski lanuched a game they wrote using Rails and Hotwire β†’ Tetris on Ruby

Source: @realPawelS (read on nitter)

πŸš€ Kevin Newton announced they build a new website Ruby Representations to show how various tools represent Ruby code:

Source: @kddnewton (read on nitter)

πŸ“… Events

πŸ“… Friendly.Rb announced they published the schedule at Friendly.rb - Your friendy European Ruby conference

Source: @friendlyrb@ruby.social

πŸ“… Rocky Mountain Ruby announced tickets for Rocky Mountain Ruby 2023: And we're back! are available

πŸ“… Helvetic Ruby announced that CFP for lightning talks is now open β†’ Helvetic Ruby Conference 2023

Source: @helvetic_ruby@ruby.social

πŸ‘‰ All about Code and Ruby

πŸ‘‰Nate Berkopec shared a tip about Active Record pool size:

Source: @nateberkopec@ruby.social

πŸ‘‰ Opsitive shared about what they love about Ruby:

Source: @opsitive@ruby.social

πŸ‘‰Tim Riley shared the roadmap for Hanami 2:

Source: @timriley@ruby.social

πŸ‘‰I shared a thread showing how I used Cursor IDE to create some small Pull Requests for rubyandrails.info

Source: @lucian@ruby.social

πŸ‘‰ John Nunemaker shared a code sample:

Source: @jnunemaker@ruby.social

Kasper Timm Hansen replied with a proposal:

Source: @kaspth@ruby.social

Esparta replied with another proposal:

Source: @esparta@ruby.social

Stephann V. replied with another suggestion:

Source: @ste@ruby.social

πŸ‘‰ Vidar Hokstad shared the progress they are doing for their pure Ruby terminal:

Source: @vidar@ruby.social

πŸ‘‰ Postmodern asked about an elegant way to create a scale of Symbols:

Source: @postmodern@ruby.social

Here are some solutions proposed:

Source: @kuba@ruby.social
Source: @p8@ruby.social
Source: @maxim@ruby.social
Source: Source: @davetron5000@ruby.social (I changed the formatting of the code a bit to make it smaller in height)

Please consider becoming a paid subscriber to support this newsletter and you will receive an ad-free version. Your contribution aids growth and maintains the quality of ShortRuby for everybody:

πŸ‘‰John Nunemaker shared a code sample showing how they use application_form:

Source: @jnunemaker@ruby.social

πŸ‘‰ Nate Berkopec shared about service objects:

Source: @nateberkopec (read on nitter)

πŸ‘‰ Deepak Mahakale shared a Ruby tip about using filter_map over map.compact:

Source: @deepakmahakale (read on nitter)

πŸ‘‰ Vincent Rolea shared how Active Storage blogs are uploaded to the storage service after the model transaction commits:

Source: @vincentrolea (read on nitter)

Victor Campos proposed a solution by using create_and_upload!

Source: @CamposLVictor (read on nitter)

πŸ‘‰ Moses Gathuku shared a tip about disabling multiple form controls:

Source: @Gathukumose (read on nitter)

πŸ‘‰ Matt Swanson shared a code sample about changing behavior of Rails apps based on user agent using platform_agent gem:

Source: @_swanson (read on nitter)

πŸ‘‰ Deepak Mahakale shared about adding a message to the assertion:

Source: @deepakmahakale (read on nitter)

πŸ‘‰ Matt Swanson shared an advice about using Rails attributes API for casting instead of Date.parse and to_i:

Source: @_swanson (read on nitter)

πŸ‘‰ Eric Berry shared a gist Tailwind Grid Helper that helps creating grids with same width and height:

Source: @coderberry (read on nitter)

πŸ‘‰ Nate Berkopec shared a thought about replacing SQL with key/value stores

Source: @nateberkopec (read on nitter)

πŸ‘‰ Nate Hopkins shared a Docker file about Ruby + SQLite Dockerfile

Source: @hopsoft (read on nitter)

πŸ‘‰ Vincent Rolea shared a code sample about how to create a method that has params that act like kwargs without being a kwarg:

Source: @vincentrolea (read on nitter)

πŸ‘‰ Daniel Hoelzgen shared about eager loading scoped associations:

Source: @dhoelzgen (read on nitter)

πŸ‘‰ Jesper Christiansen shared about using class_names helper with current_page? in Rails:

Source: @jespr (read on nitter)

πŸ‘‰ It's A&L shared a tip about delegate_missing_to in Rails:

Source: @itsAL83738725 (read on nitter)

πŸ‘‰ u/Nesdnt asked about learning Ruby:

Source: https://redd.it/16byrpf

πŸ‘‰ u/devanil asked about how to combine multiple services/programs without going to microservices:

Source: https://redd.it/16d9a86

There are not many replies, but I think it is a great question to think about. Here is one of the suggestions:

Source: https://www.reddit.com/r/rails/comments/16d9a86/comment/jzo9mox


🧰 Gems, Libraries, Tools and Updates

🧰 Ruby on Rails announced a new release for version 7.0.8 Ruby On Rails &Mdash; Rails 7.0.8 Has Been Released

Source: https://rubyonrails.org/2023/9/9/Rails-7-0-8-has-been-released

🧰 Typescript was removed from Hotwire with this PR

Source: https://github.com/hotwired/turbo/pull/971#issuecomment-1708430006

This move generated a wide range of reactions in our community. I could not follow all discussions about this everywhere. Here is a sample in case you want to read what people are saying about this, here are some places:

  • First, I do recommend reading the comments in the PR itself

  • HackerNews has two stories: this one (with 79 comments) and this one (with 119 comments)

  • There were various discussions on Ruby.social: one, two, three

  • There were various discussions on Twitter: one (nitter), two (nitter), three (nitter), four (nitter), five (nitter), six (nitter), seven (nitter), and probably many more

πŸ†•πŸ§° Nate Berkopec shared a new profiles vernier: next generation CRuby profiler

Source: @nateberkopec (read on nitter)

🧰 Avi Flombaum announced a new release of shadcn/ui on Rails version 0.0.12:

Source: @aviflombaum (read on nitter)

🧰 Stanislav Katkov announced the release of POSH TUI v0.5

Source: @5katkov (read on nitter)

πŸ†•πŸ§° LΓ‘zaro Nixon announced a new gem turbo-native-initializer

Source: @lazaronixon (read on nitter)

πŸ†•πŸ§° Equivalent announce a new gem dude_policy: policy objects for Ruby on Rails from perspective of current user/account

Source: https://github.com/equivalent/dude_policy

🧰 Brad Gessler announced that nopassword gem now includes Google OAuth with just a plain ol' Rails controller (no OmniAuth!)

Source: https://github.com/rubymonolith/nopassword#oauth-authorizations

🧰 Paul Mucur announced a new release of re2 - Ruby bindings to re2, an "efficient, principled regular expression library”

Source: https://github.com/mudge/re2/releases/tag/v2.0.0.beta1

🧰 Ilya Zykin published a new release for their Rails Starter Kit pReleases · The Teacher/Rails7 Startkit

Source: https://github.com/the-teacher/rails7-startkit/releases

πŸ†•πŸ§° Sven Schwyn published a new gem called minitest-substitute-Substitute values for the duration of a block or a group of tests

Source: https://github.com/svoop/minitest-substitute

πŸ†•πŸ§° Rahoul Baruah published a new gem standard-procedure/standard-procedure-attribute - Signal-style observable attributes in Ruby

Source: https://github.com/standard-procedure/standard-procedure-attribute

🧰 Kevin Newton announced a new release for yarp Release v0.11.0 · ruby/yarp

Source: https://github.com/ruby/yarp/releases/tag/v0.11.0

πŸ†•πŸ§° Andrey Novikov announced a new gem freezolite: Automatically add frozen_string_literals to selected files at compile time

Source: https://github.com/ruby-next/freezolite

🀝 Related (but not Ruby-specific)

🀝 Jason Swett shared about what is a good code:

Source: @JasonSwett (read on nitter)

🀝 Matt Swanson shared a trick from Chrome inspector:

Source: @_swanson (read on nitter)

🀝 Konnor Rogers shared about building web components when SSR:

Source: @RogersKonnor (read on nitter)

🀝 Mike Perham asked if is there a use strict for CSS:

Source: @getajobmike@ruby.social

Stephann V. tried to propose a solution via using iframe:

Source: @ste@ruby.social

🀝 Nate Hopkins shared the result of a 2019 survery:

Source: @hopsoft (read on nitter)

🀝 Cezar Halmagean shared about SaaS pricing:

Source: @chalmagean (read on nitter)

🀝 Catalin Pit shared about talking in public about salary:

Source: @catalinmpit (read on nitter)

More content: πŸ“š πŸ—ž 🎧 πŸŽ₯ ✍🏾

πŸ—ž Newsletters

πŸ—ž Harrison Broadbent published a new edition about The Rails Notes Newsletter Issue #10

πŸ—ž Ruby Weekly published a new edition about Ruby Weekly Issue 668: September 7, 2023

πŸ—ž Awesome Ruby Newsletter published a new edition about Awesome Ruby Newsletter Issue 381

πŸ—ž Greg Molnar published a new edition of Rails Tricks about Throttling Rails Logins With Rack Attack

πŸ—ž Vipul A M published a new edition about This Week in Rails β†’ Infer Primary Key: :Id On Associations With Composite Primary Key Models, Add Validation Option For Enum And More

πŸ—ž Allison Pike published a new edition about Once A Maintainer: Marc AndrΓ© Lafortune

πŸ—žοΈ JoΓ«l Quenneville and Stephanie Minn published a new edition of The Bike Shed about 400: How To Search

πŸ—žοΈ RubyRadar published a new edition about What’S All The Type About?

🎧 Podcasts

🎧 Remote Ruby published a new episode about Remote Ruby | Sorry For Slandering Yet Another Gem

🎧 The Ruby on Rails Podcast published an article about Episode 486: High Performance Postgre Sql For Rails With Andrew Atkinson

🎧 Lucas Barret published a new episode of GemRuby Show about about Vladimir Dementyev, Action Policy

🎧 Indie Rails published a new podcast about IndieRails | Adam McCrea - Scaling Up an Autoscaling SaaS

πŸ“½οΈ πŸŽ₯ Videos

Talks

πŸ“½οΈ Rubber Duck Dev Show published a new edition of their show Rubber Duck Dev about Should You Resolve All Of Your Exceptions?

πŸ“½οΈ Honeypot published an episode about David Heinemeier Hansson: Microservices vs. Monolith

πŸ“½οΈ Visuality published the videos from Ruby Warsaw Community Conference β†’ See them all on this Youtube Playlist

πŸ“½οΈ Jason Swett published new videos about How to plan a software project and Setting up CI with GitHub Actions

Screencasts

πŸŽ₯ Joe Masilotti published a new video about How to add SwiftUI views to Turbo Native apps (see it here on nitter or on Piped.video)

πŸŽ₯ Yaroslav Shmarov published a new video about Stripe Subscriptions With Rails 7 You Tube

πŸŽ₯ Dean De HartΒ published new videos about:

  • Adding Jest Testing React On Rails Part 9 You Tube

  • Refactor The Create And Edit Services React On Rails Part 8

  • Refactoring Get And Delete Services | React On Rails 7

πŸŽ₯ Drifting Ruby published a new video about:

  • I’m A Teapot

  • System Tests

πŸŽ₯ Adam Mccrea published a new video about published an article about Pair With Me As We Build An Alpine.Js Component From Scratch

✍🏾 Articles

What’s new πŸ†•

David Heinemeier Hansson published a new article announcing Turbo 8 is dropping TypeScript β†’ β€œJust because Turbo 8 is dropping TypeScript won't mean you can't write your client code in it, or use any other library that employs it. We get to mix and match, which is wonderful”

I published an article about How To Use Cursor Ide To Make Changes In A Rails App β†’ β€œPath of my learning path about using AI/LLMs to augment my developer productivity. I started using Cursor IDE. Here let me show you how I made two changes to the rubyandrails.info website”

Stephen Margheim published a series of articles about SQLite: Branch-specific databases, Fine-tuning your database, Loading extensions, Setting up Litestream, Optimising Compilation β†’ β€œI want to dig into the ways that we can take advantage of and empower using SQLite as the database engine for our Rails applications”

Andy Maleh published an article about Intro To Ruby In The Browser β†’ β€œThis talk will help Ruby on Rails software engineers get started with Ruby in the browser while providing demos along the way via an actual Rails app”

Alkesh Ghorpade published an article about Rails 7.1 Makes It Possible To Execute Tests For A Given Range Of Lines In A File β†’ β€œIn Rails 7.1, developers can now run tests for a specific section of code by passing a line range (a-b) to the rails test command”

Ruby Central published an article about Community Day At Ruby Conf 2023 Highlights Connection, Collaboration’s Mentorship β†’ β€œRuby Central, Inc. announced a completely reimagined format for RubyConf 2023. The 23rd annual Ruby Conference, taking place in San Diego, California, will kick off with Community Day, which is replacing one day of talks”

Alkesh Ghorpade published an article about Rails 7.1 Removes The Secrets:Setup Command And Deprecates Secrets:Edit And Secrets:Show Commands β†’ β€œIn Rails 7.1, the deprecated secrets:setup command is removed, and deprecation warnings are now issued for secrets:edit and secrets:show commands”

Luan GonΓ§alves Barbosa published an article about Ruby and the State of Artificial Intelligence β†’ β€œIn this article, we delve into the State of Artificial Intelligence and Machine Learning in the Ruby Ecosystem, exploring the tools available, challenges faced, progress made, and the potential for the future”

JoΓ«l Quenneville and Neil Carvalho published an article about A Peek Behind The Curtain Of Our New Open Source Page β†’ Talks about the technical challenges encountered while building their open source page

Deep Dives πŸ”

Jacob Daddario published a new article about The Proper Use of Ruby Mocks β†’ β€œThe problem with this is that developers often learn how to use mocks but not why to use them. This post seeks to bridge that gap by discussing why and when to use mocks in a Ruby application”

Akshay Khot published an article about Let’s Read The Turbo Source: What Happens When You Click A Link? β†’ β€œIn this post, we'll explore the source code of Hotwire's Turbo library to understand exactly what happens when you click a link. I hope you'll appreciate Turbo much more after this deep dive”

Karol Galanciak published an article about Integration Patterns For Distributed Architecture β†’ β€œLet’s examine the four primary ways services can be integrated and how they all play their part in our architecture in Smily (formerly BookingSync). This article aims to provide a general overview of these patterns, and we will cover them in more detail in the upcoming blog posts”

Felipe Vogel published an article about Server Sent Events β†’ β€œIn my last post, I rewrote a little Rails app with Roda and Turbo Streams. In this post I’ll show how I solved the app’s last and biggest problem: slow API calls. So slow that the user had to wait several seconds between pressing the β€œNext article” button, and actually seeing a new article”

Szymon Fiedler published an article about The Most Underused Pattern In Ruby β†’ β€œI believe that Value Object is a totally underused pattern in Ruby ecosystem. That’s why I wanted to provide yet another example which differs from typical Money one you usually see. It’s a great tool to reduce complexity of your code by removing unnecessary or repeatable branching”

Kyle D'oliveira published an article about Off To The Races: 3 Ways To Avoid Race Conditions Dev Community β†’ β€œThere are two example categories of race conditions that I would like to talk about and then touch on how to approach addressing them: Read-modify-write and Check-then-act”

How-Tos πŸ“

evait security GmbH team published an article about Implementing Accessed At To Active Storage Blob In Ruby On Rails β†’ β€œIn this technical blog post, we’ll explore how to enhance your RoR application by adding an accessed_at column to ActiveStorage Blobs and customizing the ActiveStorage::Blobs::RedirectController. This will allow you to track when someone accesses a specific blob or file, such as through a download action”

Stephen Margheim published an article about Linked Headings In Your Bridgetown Rb Site β†’ β€œOne feature that I wanted to support with my blog is having headings that provide a quick anchor link to that section of the page. In this post, I want to walk you through the simple steps to add this feature to a Bridgetown site”

Thomas Riboulet published an article about An Introduction To Rubo Cop For Ruby On Rails β†’ β€œHere follows an introduction to RuboCop: what it is, how it helps developers, how to use it, and some key practical use cases”

James Brooks published an article about Enhanced Broadcasting With Action Cable | James Brooks β†’ β€œAn extract of a technique I’ve been running successfully to only render and broadcast payloads over ActionCable for users that are actively subscribed to the channel”

Ashwini Sukale published an article about 7 Common Techniques To Improve Your Debugging Skills Fast Ruby.Io | Rails Upgrade Service β†’ β€œWhen we work on Rails upgrades, most of the time we have to solve issues after updating the gems. These problems can go from simple and straightforward to really complex and hard to debug. Here we will discuss different skills and techniques that we use to complete the upgrade”

Gorka Pitarch published an article about Nested Attributes On A Has Many :Through Polymorphic Association With Validations In Ruby On Rails β†’ β€œA very common functionality for websites is the possibility of adding tags or categories. In this post, I’m going to implement this functionality in a way that you can categorize different models. In this example, I’m only going to create a Post model but you can repeat this process for any other model you want to”

Nicholas Galante published an article about Using Regular Expressions (Reg Ex) For Validations In Rails Dev Community β†’ β€œIn this blog post, first we'll look at some of the basic characters used in RegEx. Then, we'll explore some examples o to use RegEx to create various validations in Rails, including formatting for password strength, special character requirements, monetary amounts, email addresses, and zip codes”

Josh Smith published an article about Emmet Snippets In Rails Views β†’ β€œSupport for this is built in for the current most popular editor: VSCode. But if you work with Rails a lot, you'll probably notice that it does not work in erb template files out of the box. Let's enable it!”

Dom Christie published an article about Ui Context And Rails Variants β†’ β€œRather than a 1:1 mapping of routes to controller actions, Kasper suggested mapping different routes to a single controller action, and switching the response based on the variant. The variant could be sent as a default param and set in the controller”


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:

Support the newsletter for ~ $1.8/month

If you consider upgrading and want more information, please read Why to subscribe to paid.

2
Share this post

Short Ruby News - Edition #58

newsletter.shortruby.com
Share
Previous
Next
Comments
Top
New
Community

No posts

Ready for more?

Β© 2023 Lucian Ghinda
Privacy βˆ™ Terms βˆ™ Collection notice
Start WritingGet the app
Substack is the home for great writing