Short Ruby Newsletter

Share this post

Short Ruby News - Edition #53

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 #53

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

Lucian Ghinda (from ShortRuby)
Jul 31, 2023
Share this post

Short Ruby News - Edition #53

newsletter.shortruby.com
Share

You can jump directly to a section:

๐Ÿ‘ Our Community

๐Ÿ‘‰ย All about Code and Ruby

๐Ÿงฐย Gems, Libraries, and Updates

๐Ÿคย Related (but not Ruby-specific)

More content: ๐Ÿ—ž ๐ŸŽง ๐ŸŽฅ โœ๐Ÿพ (articles, podcasts, videos, newsletters)


[Sponsorโฌ‡]

Subscribe at railsnotes.xyz/newsletter
Harrison here from The RailsNotes Newsletter โ€” each week, I send out a 5 min read covering a few great Ruby on Rails articles from my blog and around the web. 
If you like ShortRuby, you'll probably like The RailsNotes Newsletter, too, so come check it out!

Subscribe and read the latest issue here โ€” https://railsnotes.xyz/newsletter

๐Ÿ‘ Our Community

๐Ÿ‘ Kasper Timm Hansen announced a new project called Open Source Retreat โ€” Summer 2023

Source: @kaspth (read on nitter)

๐Ÿ‘ RailsWorld published the final list of speakers Meet the Rails World Speakers:

Source: @rails (read on nitter)

๐Ÿ‘ Avi Flombaum started to re-start the NYC on Rails | Meetup again:

Source: @aviflombaum (read on nitter)

๐Ÿ‘ Avi Flombaum also announced rails-components.com - Themed Components for Ruby on Rails

Source: @aviflombaum (read on nitter)

๐Ÿ‘ Ruby City Matsue announced Ruby Prize 2023 is now accepting recommendations:

Source: @rubycitymatsue (read on nitter)

๐Ÿ‘ Chris Oliver announced the beginning of Rails Hackathon Begins which happened in the last weekend.

Source: @excid3 (read on nitter)

The hackathon ended but you can see the projects at railshackathon.com and vote the ones that you like.

Source: @excid3 (read on nitter)

๐Ÿ‘ The Rubber Duck Dev Show shared their schedule for the next month:

Source: @duckiedevshow (read on nitter)

๐Ÿ‘‰ All about Code and Ruby

๐Ÿ‘‰ /u/eggbrain asked about the current state of Rails WYSIWYG / Rich Text Editor integrations:

Source: https://i.reddit.com/1596vs4

The recommended answers are:

  • TinyMCE

  • Trix

  • Editor.js - for ingregration checkout Dean videos Editor.js in Ruby on Rails 7 with Stimulus! and Editor.js Image Uploads with Active Storage

  • TipTap editor

  • Rhino-editor (that integrates TipTap currently)

  • Quill (integrates via quilljs-rails)

๐Ÿ‘‰ Okura Masafumi shared how they think about tests and using tests as documentation:

Source: @okuramasafumi@ruby.social

๐Ÿ‘‰ Xavier Noria shared a thread about :: in Ruby:

Source: @fxn (read on nitter)
Source: @fxn (read on nitter)

And Yukihiro Matz replied:

Source: @yukihiro_matz (read on nitter)

Kevin Newton added:

Source: @kddnewton (read on nitter)

Nick Schwaderer shared gist showing other ways to use ::

Source: @schwad_rb (read on nitter)

and Xavier added more:

Source: @fxn (read on nitter)

๐Ÿ‘‰ Nick Schwaderer shared a code sample from Scarpe Morning serenity bloops song to wake people up and get their hackdays started right by Schwad ยท Pull Request #327 ยท scarpe-team/scarpe

Source: @schwad_rb (read on nitter)

๐Ÿ‘‰ I asked about recommendations of open-source repos:

Source: @lucian@ruby.social

You can read the replies on ruby.social and on twitter (alternative on nitter)

Here are some of the recommendations:

  • Anything written by Nate Berkopec or Chris Oliver

  • act_as_tenant gem

  • rails

  • camping

  • Ruby

  • invoice_printer gem

  • Ruby Fundamentals

  • Ruby Classes and Modules

  • Ruby Best Practices List

  • Ruby Koans

  • batch-loader gem

  • friendly_id gem

  • ializer gem

  • money gem

  • propshaft gem

  • pundit gem

  • rolify gem

๐Ÿ‘‰ Marco Roth shared a code sample showing how to use the Stimulus Elements API (read the full blog post)

๐Ÿ‘‰ Olivier Lacan asked about recommendations of Ruby powered companies working on climate solutions:

Source: @olivierlacan@ruby.social

๐Ÿ‘‰ Rob Zolkos asked a question on social media and on the Ruby on Rails forum Do Basecamp/Hey use ViewComponents?

๐Ÿ‘‰ Olivier Lacan shared a screenshot of bundle up gem:

Source: @olivierlacan@ruby.social

๐Ÿ‘‰ Nate Hopkins announced a revamped of the TurboBoost Commands website:

Source: @hopsoft (read on nitter)

๐Ÿ‘‰ Jonathan Markwell shared what projects helped them the most for building SaaS:"

Source: @jot (read on nitter)

Short Ruby Newsletter is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.

๐Ÿ‘‰ Janko Marohniฤ‡ shared a thread about generating passkeys with Rodauth:

Source: @jankomarohnic (read on nitter)
Source: @jankomarohnic (read on nitter)
Source: @jankomarohnic (read on nitter)
Source: @jankomarohnic (read on nitter)

๐Ÿ‘‰ The Rails Changelog shared a Rails tip to append to a collection of attached files:

Source: @railschangelog (read on nitter)

๐Ÿ‘‰ Greg Navis shared about the Ruby safe navigation operator is a code smell:

Source: @gregnavis (read on nitter)

Among other replies, Rostislav Zhuravsky shared another perspective about this:

Source: @w0arewe (read on nitter)
Source: @w0arewe (read on nitter)

๐Ÿ‘‰ Marc Kรถhlbrugge shared how they use SQL queries to do funnel analysis:

Source: @marckohlbrugge (read on nitter)
Source: @marckohlbrugge (read on nitter)

๐Ÿ‘‰ Martin Spickermann shared a piece of code showing how to use ActiveRecord#find

Source: @spickermann (read on nitter)

๐Ÿ‘‰ Greg Navis shared a thread about database constraints in Rails. Read the full thread @gregnavis or read it on nitter:

Source: @gregnavis (read on nitter)

๐Ÿ‘‰ John Nunemaker shared how to use bundler to update git source:

Source: @jnunemaker (read on nitter)

๐Ÿ‘‰ Chuck Smith shared about the biggest challenge as a contractor when upgrading Rails:

Source: @EclecticCoding (read on nitter)

Adrian Oprea replied with:

Source: @oprearocks (read on nitter)

๐Ÿ‘‰ Adam shared about memoizing a class instance variable and thread safety:

Source: @Robodisco (read on nitter)

๐Ÿ‘‰ Harrison Broadbent shared a tip to make a turbo frame tag scroll into view:

Source: @hrrsnbbnt (read on nitter)

๐Ÿงฐ Gems, Libraries, Tools and Updates

๐Ÿงฐ Lewis Buckley announced a new gem basecamp/rspamd-ruby: Ruby client for Rspamdโ€™s HTTP API. Rspamd is a โ€œFast, free and open-source spam filtering systemโ€

Source: https://github.com/basecamp/rspamd-ruby

๐Ÿงฐ JetBrains announced the release of RubyMine 2023.2 with AI Assistant included. Read the full list of improvements in the Whatโ€™s new announcement

Source: https://www.jetbrains.com/ruby/whatsnew/

๐Ÿงฐ Dima Fatko published a new version of online_migrations (โ€œCatch unsafe PostgreSQL migrations in development and run them easier in productionโ€)

Source: https://github.com/fatkodima/online_migrations/blob/master/CHANGELOG.md#080-2023-07-24

๐Ÿงฐ Steve Jackson and Daniel Huss published a new gem gem_dating - GemDating is a library for determining the relative age of a set of gems

Source: https://github.com/testdouble/gem_dating

๐Ÿงฐ Charlton Trezevant announced a new gem devise-sssecrets - is a handy gem for generating secure tokens that are easy for static analysis tools to identify (you can checkout the Rails demo app here)

Source: Charlton Trezevant on Linkedin

๐Ÿงฐ Igor Alexandrov announced the Release v0.15.0 ยท mrsked/mrsk

Source: https://github.com/mrsked/mrsk/releases/tag/v0.15.0

๐Ÿงฐ Brad Gessler announced rubymonolith/guard-zeitwerk: Automatically add module declarations, inflected from Zeitwerk, to your empty files.

Source: https://github.com/rubymonolith/guard-zeitwerk

๐Ÿงฐ Xavier Noria announced the release of version 2.6.9 of Zeitwerk Read the changelog

Source: https://github.com/fxn/zeitwerk/blob/main/CHANGELOG.md

๐Ÿงฐ Takashi Kokubun announced the merge of YJIT: Fallback send instructions to vm_sendish by k0kubun ยท Pull Request #8106 ยท ruby/ruby

Source: https://github.com/ruby/ruby/pull/8106

๐Ÿงฐ Andrea Fomera announced a new gem afomera/richer_text - RicherText is a Rich Text Editor based on TipTap for Ruby on Rails

Source: https://github.com/afomera/richer_text

๐Ÿงฐ Koichi Ito shared GitHub - rubocop/vscode-rubocop: The official VS Code extension for the RuboCop linter and code formatter that enables real-time, high-speed `rubocop -x` in VScode:

Source: https://github.com/rubocop/vscode-rubocop#rubocoplayoutmode

๐Ÿงฐ Janko Marohniฤ‡ announced the Release 1.10.0 ยท janko/rodauth-rails

Source: @jankomarohnic (read on nitter)

๐Ÿงฐ Avi Flombaum announced the release of version 0.5.0 of shadcn-rails. Checkout latest commits

Source: @aviflombaum (read on nitter)

๐Ÿงฐ Janko Marohniฤ‡ shared that support for passkeys is released to roaduth Add internal request support for WebAuthn by janko ยท Pull Request #355

Source: https://github.com/jeremyevans/rodauth/pull/355

๐Ÿงฐ Brad Gessler announced they proposed a PR (not merged) for Implementation of Phlex::Rails::Actions by bradgessler ยท Pull Request #104 ยท phlex-ruby/phlex-rails

Source: https://github.com/phlex-ruby/phlex-rails/pull/104

๐Ÿงฐ Lewis Buckley announced a new plugin for yabeda basecamp/yabeda-rack-ratelimit: Yabeda plugin for Rack::Ratelimit

Source: https://github.com/basecamp/yabeda-rack-ratelimit

๐Ÿงฐ Juliรกn Pinzรณn shared that this PR is merged to cssbuilding-rails Add PostCSS import plugin as default by pinzonjulian ยท Pull Request #126

Source: https://github.com/rails/cssbundling-rails/pull/126

๐Ÿงฐ Greg Navis announced a release of a new version active_record_doctor - Identify database issues before they hit production

Source: @gregnavis (read on nitter)

๐Ÿงฐ Thomas Countz announced version 0.2.0 of their genetic algorithm gem petri_dish_lab - A Ruby library for Evolutionary Algorithms

Source: https://github.com/Thomascountz/petri_dish

๐Ÿงฐ Evgeniy Demin announced a new release of djezzzl/n1_loader: Loader to solve N+1 issues for good. Highly recommended for GraphQL API.

Source: https://github.com/djezzzl/n1_loader

๐Ÿงฐ Joshua Young proposed a new feature to be added to Ruby language Enumerable#uniq_map

Source: https://bugs.ruby-lang.org/issues/19787

Thank you for reading Short Ruby Newsletter. This post is public, so feel free to share it.

Share

๐Ÿค Related (but not Ruby-specific)

๐Ÿค Andrew Morris shared what Kafka is exchanging as commands for the health check:

Source: @Andrew___Morris (read on nitter)

๐Ÿค Adrian Oprea shared an insight about simple code:

Source: @oprearocks (read on nitter)

๐Ÿค More content: ๐Ÿ“š ๐Ÿ—ž ๐ŸŽง ๐ŸŽฅ โœ๐Ÿพ

๐Ÿ—ž Newsletters

๐Ÿ—ž Harrison Broadbent published a new edition of RailsNotes Newsletter Issue 4

๐Ÿ—ž Ruby Weeklyย published a new edition aboutย Machine learning in Ruby

๐Ÿ—ž Ruby Radar published a new edition about Mind Expansion

๐Ÿ—ž Matheus Richard published a new edition of This week in #dev

๐Ÿ—ž This Week in Rails published a new edition This Week in Rails - July 28, 2023

๐Ÿ—ž Ruby LibHunt published a new edition of the Awesome Ruby Newsletter

๐Ÿ—ž Ruby Central published a new edition of their monthly updates June 2023 Monthly Update

๐Ÿ—ž The Bike Shed published a new episode about Submitting a Conference Talk Proposal from Start to Finish

๐ŸŽง Podcasts

๐ŸŽง Rubber Duck Dev Show published a new episode about Scarpe Diem With Nick Schwaderer โ†’ โ€œIn this episode of the Rubber Duck Dev Show, we discuss Scarpe, which is a successor to the Shoes Ruby desktop application builder with Nick Schwadererโ€

๐ŸŽง Remote Ruby published a new episode about The One Where We Talk About Our STIs โ†’ โ€œJason, Chris, and Andrew dive deep into their personal adventures and tech talks, including a detailed discussion on Single Table Inheritance (STI) in Ruby on Rails, sharing different perspectives, use-cases, and alternatives.โ€

๐ŸŽง Indie Rails published a new podcast about IndieRails | Khash Sajadi - The Journey to the Cloud(66) โ†’ โ€œJoin us as we listen in to Khash as he shares his story of startup failures & successes, consulting and employment in between and navigating political, economic and geographical constraintโ€

๐ŸŽง The Ruby on Rails Podcast published a new episode about Gnarly Rails with Nick Maloney โ†’ โ€œNick and Brittany discuss Gnar's project for the State of Massachusetts to build out an automated background check system. Nick shares why Rails is their default stack and why he is particularly impressed with the direction of the front-end happening in Rails 7.โ€

๐ŸŽง Jason Swett published a new podcast about 191 - Payload CMS (YC S22) with Dan Ribbens - The Code with Jason Podcast โ†’ โ€œThis week, I'm joined by Dan Ribbens for an in-depth conversation about his headless CMS software Payload CMS. We also discuss other CMS platforms and Dan's experience with Y Combinatorโ€

๐ŸŽง Slow & Steady published a new podcast about Database constraints with Andrew Atkinson | Slow & Steady โ†’ โ€œBenedikt talks to Andrew Atkinson about different types of database constraints and his upcoming bookโ€

๐Ÿ“ฝ๏ธ ๐ŸŽฅ Videos

๐Ÿ“ฝ๏ธAny Cable published a new video about AnyCable v1.4: reliable real-time for all: Ruby, Rails, Hotwire and beyond

Screencasts

๐ŸŽฅ Dean De Hartย published new videos about:

  • Offline User Account Speedrun with Devise in Rails 7

  • Load New Tweets Button with Action Cable | Ruby on Rails 7 Tutorial

  • Handling Multiple File Uploads in Rails 7 | Ruby on Rails 7 Tutorial

  • Persistent User Preferences with Cookies & Devise | Ruby on Rails 7 Tutorial

  • Send Admin Emails on User Sign Up with Rails 7 & Devise

๐ŸŽฅ Ruby Cademy published a new video about IntuitiveClassName + EncapsulatedMethods = Joy!

โœ๐Ÿพ Articles

Whatโ€™s new

Breno Gazzola published a great guide about Active Storage in production: lessons learned and in-depth look at how it works โ†’ โ€œWhile we love Active Storage (which Iโ€™ll call AST from now on), there are certain design decisions in AST that one should be aware of, as they have an impact on the overall performance of the app, and not just the pages that use ASTโ€

Nikola ฤuza published a new article about Using Server-Sent Events (SSE) to Stream Data in Rails โ†’ โ€œUsually, a page sends a request to the server to receive new data. That is how most of us develop the web nowadays. What if I told you there is another way to get the data to the page? With server-sent events, a server can send new data to a web page at any time by pushing messages to the web page.โ€

Marco Roth published a new article about Supercharge your Stimulus controllers with Custom APIs โ†’ โ€œwe will explore the process of creating a new Stimulus API that can be used in any Stimulus Controller.โ€

Avi Flombaum published a new article about Building shadcn Form Builders in Rails โ†’ โ€œFor shadcn on rails, I wanted to create a custom form builder that would plug my shadcn form inputs and controls into ActiveModel so that the error validations and other features native to Rails forms would workโ€

Kevin Luo published a new article about Dear AI, can you translate the Rails Guide for me? โ†’ โ€œI used ChatGPT API to translate the Rails Guide into different languagesโ€

Alkesh Ghorpade published a new article about Rails 7.1 adds the --parent option to the controllers โ†’ โ€œRails 7.1 adds the --parent options to controller generator that helps the developer pass the parent controller name. You must pass --parent=CONTROLLER_NAME to the rails generate controller commandโ€ and another one exploring Rails 7.1 adds picture_tag helper to support HTML5 picture element.

Steve Polito published an article, about Are you absolutely sure your Rails caching strategy isn't leaking sensitive information? โ†’ โ€Rails writes a new cache entry based on the first request. But what happens when that request is from an admin?โ€

Rafael Peรฑa Azar published a new article about Exploring Genetic Algorithms with Ruby โ†’ โ€œwe'll dive into the intriguing realm of genetic algorithms in Ruby and explore real-life applications that showcase their potential. These algorithms mimic the principles of Darwinian evolution, and when combined with the expressive and elegant Ruby language, they become a powerful toolset for tackling a wide range of challengesโ€

Lucas Barret published a new article about Services Object with GraphQL And Rails โ†’ where Lucas explains how a service layer in Rails and GraphQL can manage code complexity, improve readability, and enable better testing..

Avi Flombaum published a new article about Generating Audio Waveform Images in Ruby โ†’ โ€œIn this post we'll walk through some Ruby code that generates a waveform image from an audio fileโ€

Gavin Morrice published a new article about Avoiding train-wrecks in ActiveRecord โ†’ โ€œone doesnโ€™t have to look far in a Ruby on Rails codebase to see chains of ActiveRecord scope methods being called on a model or ActiveRecord::Relation object like this. This chain of methods all smooshed together like a crashed train with many carriages is what some people affectionately call a ยซtrain-wreckยปโ€

Deep Dives

Cody Norman published a new article about Using Concerns With Ruby On Rails โ†’ โ€œI thought this was a great opportunity to refresh myself on some of the details around Concerns in Rails, why theyโ€™re useful and how to implement them.โ€

Olly Chadwick published two articles about Loading files in Ruby and Loading files in Rails โ†’ โ€œ First, weโ€™re going to talk about how Ruby finds other files. Then, once weโ€™ve got our head around that, weโ€™re going to look at the extra sprinkles of magic that Rails adds on top.โ€

Daniel Lempesis published an article about An Introduction to Metaprogramming in Ruby โ†’ โ€œIn this post, we'll take a look at metaprogramming methods like send, define_method, and method_missing and show how they can solve problems we sometimes run into, even in normal Rails applicationsโ€ [If you want you can check the comments about this on HN]

Andrew Stewart published an article about Introduction to Discard โ†’ โ€œToday, weโ€™re going to explore the history behind the discard gem, and how it can be used to add soft-deletion functionality to Rails/ActiveRecord modelsโ€

Vlad Hilko published a new article about Understanding Transaction Isolation Levels in Rails with Simple Examples โ†’ โ€œwe will discuss the usage of database transactions in a Rails application, with a particular focus on one of the ACID principles - Isolation - and its four levels. We will explore what these isolation levels are, why they are necessary, and the problems they aim to solveโ€

How-Tos

Carla Urrea Stabile published a new article about What is Role-Based Access Control (RBAC) and How to Implement it in a Rails API? โ†’ โ€œThere are different ways to implement an authorization system and the one you chose depends on your application's needs. Role-Based Access Control (RBAC) is just one of them, so let's go ahead and learn how to implement it in a Rails APIโ€

Janko Marohniฤ‡ published an article about implementing Passkey Authentication with Rodauth โ†’ โ€œI would like to show how to set each of these up in a Rails app that uses rodauth-rails. Iโ€™ll be using Safari on macOS Ventura and have iCloud Keychain sync enabled, which is a requirement for Apple passkeysโ€

Mike Coutermarsh published a new article about Setting an Actions secret with Octokit.rb - Ruby Example โ†’ โ€œHere's a Ruby example of how to set a GitHub Actions secret using Octokit in Rubyโ€

Gowsik Vivekanandan published a new article about Integrate Replicate in Rails Application โ†’ โ€œWith Replicate, we can run machine learning models in the cloud without the need to set up our infrastructure or have in-depth knowledge about machine learning. Replicate allows us to run both public and private modelsโ€

Harrison Broadbent published two articles Simple Lazy Loading in Rails with Hotwire and Turbo Frames โ†’โ€œHotwire and Turbo Frames make it easy to add lazy-loading into our Rails apps โ€” I'm talking only 12 lines of codeโ€ and Overmind ๐Ÿชฌ, a better bin/dev for your Procfile โ†’ โ€œI wish I had learned about Overmind sooner! Foreman and bin/dev were fine, but now that I've discovered Overmind, I don't see myself ever going backโ€

Akshay Khot published a new article about How to Dynamically Create Instance Variables in Ruby โ†’ โ€œThis post shows one way to dynamically initialize multiple instance variables in a Ruby class using metaprogramming. If you need to pass multiple, separate pieces of data to a constructor (and cannot refactor the code for some reason), it's a pretty good technique to reduce all the repetitive code.โ€

Matt Brictson published an article about How to organize CSS in a Railsย project โ†’ โ€œNew Rails projects start with a single CSS file: application.css. Inevitably every non-trivial app is going to have more CSS than will fit comfortably in that one file. While you may be tempted to declare a comprehensive file and folder structure up front, I suggest starting small and taking the incremental approach.โ€

Phil Smy published a new article about Revolutionize Your Rails App with DynamoDB: Unleash Speed and Scalability! โ†’ โ€œWhen developing a new service, we realized that a core model would be well-suited for storage in DynamoDB, Amazonโ€™s fast and scalable NoSQL solutionโ€ and another one about A Seamless Migration from Database to AWS S3 โ†’ about migrating email messages stores in a DB to S3 storage system.

Fiona Lapham and Ariel Juodziukynas published an article about Navigating Asset Management Madness; Rails 3.0 -> Rails 7 and Beyond โ†’ โ€œThere have been a lot of changes over the years in asset management opens a new window for Ruby on Rails applications. The main question, after all the madness, isโ€ฆ โ€œWhat should I do if I need to upgrade my Rails application?โ€

Avi Flombaum published a new article about Prettier for ERB โ†’ where Avi shares a configuration to make prettier work with *.erb files

Thomas Hareau published an article about How to release a new gem version in thirty seconds โ†’ โ€œI recently experimented process automation through GitHub action. Though there is one drawback in term of security, new gem versions can be released in two clicksโ€

Related

Ryan Bigg published a short article describing how to fix How to fix: Chromedriver 115, cannot find chrome binary on MacOS โ†’ โ€œChromedriver v115 was released recently and causes this issue to appear on Macs that use Chromedriver for automated testingโ€


Please consider becoming a paid subscriber to support this newsletter for just $1.5/week ($6.5/month). Your contribution aids growth and maintains the quality of ShortRuby for everybody:

Support the newsletter for ~1.5$/week

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

Share this post

Short Ruby News - Edition #53

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