Discover more from Short Ruby Newsletter
Short Ruby News - Edition #51
Discover the world of Ruby in this comprehensive newsletter covering week 27 of 2023. Find code samples, community updates, gems, resources, and thought-provoking discussions.
You can jump directly to a section:
More content: 🗞 🎧 🎥 ✍🏾 (articles, podcasts, videos, newsletters)
💸 For only $1.5 per week (just $6.5 a month), you can become a paid subscriber and contribute to the success of the flourishing Ruby community we all adore while receiving an ad-free version of the newsletter!!
👐 Our Community
He also announced more speakers for the conference, and the current, complete list is as follows:
▶️ if you enjoy this type of content and want to receive it weekly in your inbox you should subscribe:
👉 All about Code and Ruby
🪧 Have you considered inviting your company to sponsor this newsletter? If you are using Ruby on Rails, I think your company is a perfect fit :)
You can send the sponsorship packages info to your marketing, HR, or product management teams.
I'm happy to assist you with drafting an email. Send me a message at email@example.com I'll do my best to draft an email for you to send inside your organization.
👉 Joel Drapper asked about a recommendation of a Github app to show lines from a PR that have test coverage and the ones that don’t:
Among the recommendations:
👉 Luis Ezcurdia shared a code showing how to use pattern matching in Ruby:
👉 Jason Swett shared about naming:
You can read the replies and check other examples here.
Also, he shared this that I think is an excellent example of calling things what they are:
👉 Nate Hopkins shared about consolidating db migrations:
If you want, you can check the replies to this proposal here.
👉 Gabriel Arcangel Zayas asked about book recommendations for Rails developers:
You can check all replies here, I will list here some of the recommendations:
Practical Object-Oriented Design by Sandi Metz
Master Ruby Web Apis by Thibault
Exceptional Ruby by Avdi Grimm
Code Complete 2 by Steve McConnel
Sustainable Web Development with Ruby on Rails by Dave Copeland
Eloquent Ruby by Russ Olsen
Short Ruby Newsletter is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.
He proposed the following code:
He then explains in the thread how to use this, and the controller changes to make it work.
👉Jason Swett shared a use-case for using ChatGPT to learn:
👉Harrison Broadbent shared that rails migration generator has support for removing index:
👉Prabin Poudel asked for cases where it is better to use Ruby instead of delegating to SQL:
There are some good examples in the replies to their question.
👉 Donn Felker shared a tip for managing empty tests:
👉 Dorian shared a code sample showing generating SQL:
👉Lázaro Nixon shared a code sample showing how to set Rails timezone:
🧰 Gems, Libraries, Tools and Updates
🧰 Bridgetown announced the release of version 1.3 Presenting Islands Architecture in Bridgetown 1.3 “Kelly Butte”
🧰 Postmodern announced that Feature #19630: [RFC] Deprecate `Kernel.open("|command-here")` due to frequent security issues was accepted:
🧰 Josef Strzibny announced the release of Business Class: A brand new Ruby on Rails SaaS template on the block
For more details about these features, you should also read this article: Enter AnyCable v1.4: reliable real-time features for apps of any size
🧰 Koichi Ito announced a new release of the vscode-rubocop: The official VS Code extension for the RuboCop linter and code formatter.
🤝 Related (but not Ruby-specific)
🤝 Nate Berkopec shared about queue management:
🤝 Stanislav (Stas) Katkov shared about code review pyramid:
🤝Donn Felker shared how to check the git diff stats:
🤝 Josh Branchaud shared about the leave command on Mac and BSD Unix:
🤝 More content: 📚 🗞 🎧 🎥 ✍🏾
🗞 Andy Croll published a new edition of One Ruby Thing: Beware of <%== in your erb files
🗞 Ruby Weekly published a new edition about A proposal for overloaded methods
🗞 Any Cable published a new edition about Any Cables Monthly #11
🗞 Greg Molnar published a new edition about Modifying Action Text markup - Rails Tricks Issue 14
🗞 Harrison Broadbent published a new edition of RailsNotes Newsletter → “Rails migrations, Indexes, SQL EXPLAIN, and db:migrate:redo”
🗞Ruby On Rails published a new edition of This Week in Rails about Preprocessed Active Storage variants and more → “Let’s see what changed in the Rails codebase”
🗞️ Ruby Libhunt published a new edition of Awesome Ruby Newsletter - Issue 372
🎧 Tightly Coupled Book Club published a new episode about Active Record Callbacks
🎧 Jason Swett published a new episode about Sin City Ruby Speaker Ernesto Tagwerker
🎧 Changelog published a new episode about Types will win in the end with Jake Zimmerman, Stripe working on Sorbet
🎧 Evil Martians shared a podcast episode about Giant Robots: Evil Martians with Irina Nazarova by Evil Martians
🎧Adrian Marin and Yaroslav Shmarov published a new podcast about Jonathan Markwell talks about SaaS, validating ideas, and Conferences
🎧 The Ruby on Rails Podcast published a new episode about The Rails SaaS Conference Recap with Andrew Culver
📽️ 🎥 Videos
🎥 Drifting Ruby published a new episode about Episode 410 - Academic Discount | Drifting Ruby
🎥 Ruby Cademy published new videos about:
🎥 Yaroslav Shmarov published new videos about:
🎥 Dean De Hart published new videos about:
🎥 Jesus Castello published a new video about Quick Ruby Tip: How to Benchmark Code in IRB #shorts
Justin Searls published an article about The looming demise of the 10x developer → “Envisioning programmers as belonging to discrete generations who are ushering in a dramatic transition in the industry can equip us to identify the common threads between many of the challenges we’re currently facing. It may even enable us to predict and plan for inevitable difficulties in the future, as more members of the earlier generation age out”
Henrik Nyh published an article about Ruby Module Builder patterns → “I recently discovered the Ruby Module Builder pattern. It lets you pass in arguments to dynamically generate a module at include time”
Alkesh Ghorpade published an article about Rails 7.1 introduces deliver callbacks for ActionMailer → “To simplify code and avoid using Interceptors and Observers, Rails 7.1 added deliver callbacks to ActionMailer”
I published an article exploring the question Ruby: pass by value or pass by reference? → “Investigate Ruby's approach to passing objects in methods and assignments.”
Akshay Khot published an article about How to Implement Rails-like Views in Ruby → “In this article, we will learn 'one' way to implement the controller-to-view data handoff using instance variables, just like Rails, and following the same conventions as Rails”
Povilas Jurčys published an article about Deep Dive into RSpec's let Helper → “In this article, we will dig deep to explore the potential of the let helper and it's friendly neighbors let! and subject. We will unravel its capabilities for creating reusable variables and optimizing a test code”
Mike Coutermarsh published an article about Performant database tree traversal with Rails → “Learn how to solve a tree traversal N+1 query problem in your Rails application”
Aestimo Kirina published a new article about An Introduction to Devise for Ruby on Rails → “In this tutorial, we'll use a simple Ruby on Rails 7 application featuring users and tasks. Users can register, log in, and log out, with access to create, read, update, and delete actions for tasks depending on their assigned role”
Bill Tihen published a new article about Rails with Mingines (Minimized Engines) → “if you want to have the ability to make a fully independent Engine that can be distributed eventually as a gem - but for mow avoiding a full engine, this article describes doing this”
Brad Gessler published a new article about Tokenized Tokens → An article exploring the Tokenizer service for handling secreted from Fly.io
Joel Moss published a new article about Render a React component with Proscenium → “This guide will walk you through creating a simple React component with Proscenium in a Rails application”
Harrison Broadbent published an article about Seed your database with the Faker gem. Then seed 5x faster with activerecord-import → “In this article, I'm going to show you how to combine seeds.rb with the faker gem to generate heaps of fake testing data (we're going to generate 10,000 fake Post records with faker)”
Kevin Murphy published an article about Testing Inherited Behavior → “This is something that I’ve waffled on, and changed my opinion on, seemingly each time I have to deal with this. For me, a lot of the tension comes from choosing why I’m testing. Am I testing to verify the correctness of the code, or am I testing to document expected behavior?”
Andrei Kaleshka published an article about Select unique latest grouped records from DB → “Nowadays, almost every Ruby on Rails application has a so-called recent records block. This block usually shows statistics or a list of recent things within the project during the last few days searched by some criteria. It can be something like “top 10 products”, “the most popular projects”, or “the most relevant apartments”. Read this blog post the learn how to efficiently build data for these blocks using SQL and window functions in Ruby on Rails app”
Kent Beck published a new article called Fresh Work 80/15/5 → “How do you balance risk, novelty, production, growth, short-term certainty, and long-term viability? I learned a simple rule that has been useful to me and is often cited by my students as a key lesson from coaching”
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:
If you consider upgrading and want more information, please read Why to subscribe to paid.