Rubyland

news, opinion, tutorials, about ruby, aggregated
Sources About
Ruby on Rails 

Revert Active Model’s Normalization and Cache Store gets session ID uniqueness flag

Hi, it’s zzak. Let’s explore this week’s changes in the Rails codebase.

Fix “#to_query” to not include setter for nil values
To keep the behavior consistent with Rack::Utils.parse_nested_query.

# Before
nil.to_query("key") #=> key=
# After
nil.to_query("key") #=> key

Raise “ActiveRecordError” when “#increment!” called on new records
Similar to the behavior of #update_columns, an exception will be raised on records that haven’t been saved yet or were destroyed.

Revert “ActiveModel::Attributes::Normalization”
In the last episode, we announced that ActiveRecord::Normalization was moved to Active Model.
That PR was reverted because the API wasn’t ready and is still being worked on.

Add…

code.dblock.org | tech blog 

I Participated in 2882 Meetings in 5 Years

Since my first day in AWS 5 1/2 years ago, I’ve been experimenting with keeping a CHANGELOG of everything I do, available for everyone at the company to see. I wrote about it here. If you work at AWS, use the URL in the screenshot below to find it.

I wrote a little script to try and classify where I spent my time. Here are some quick, very unscientific results.

I participated in 2882 meetings, 75% were probably technical discussions and 25% were not, including business reviews. I made 1013 code contributions, reviewed or read 364 documents, mostly technical designs. I did 192 1:1s with my colleagues, 130 interviews, and helped with 80 promos. I debugged or otherwise dealt with 175…

Aha! Engineering Blog 

Make streaming APIs easy with enumerable methods

img { max-height: 400px; margin-right: auto; margin-left: auto; } table, th, td { font-family: Red Hat Display, "Helvetica Neue", Arial, "Noto Sans", sans-serif; border: 1px solid var(--aha-gray-400); } th { background-color: var(--aha-gray-100); color: var(--aha-gray-900); text-align: left; } td img { margin: 0.5em auto !important; }

When you first discover Ruby on Rails, some things might strike you right away: namely the large number of enumerable methods and the blocks to run code in the middle of another method. Those features helped me translate my thoughts directly into code — and quickly made Ruby my favorite programming…

Enumerables are…

Ruby Central 

December 2024 Newsletter

December 2024 Newsletter

Hello! Welcome to the December newsletter. Read on for announcements from Ruby Central and a report of the OSS work we’ve done from the previous month.

Ruby Central Updates

RailsConf 2025 is official! 🎉

We are excited to officially announce that RailsConf 2025 will take place from Tuesday, July 8th to Thursday, July 10th, 2025, in Philadelphia, PA.

After nearly 20 years, RailsConf 2025 will be the final gathering of its kind — a tribute to the incredible legacy of Rails and the community members who have been on this journey with us.

As part of a strategic shift, RailsConf 2025 will be the only conference hosted by Ruby Central in 2025. This means there will be no RubyConf in 2025, but we are…

Ruby Central 

Announcing RailsConf 2025 and a New Chapter for Ruby Central Events

Announcing RailsConf 2025 and a New Chapter for Ruby Central Events

We are excited to officially announce that the final RailsConf will be taking place from Tuesday, July 8th to Thursday, July 10th, 2025, in Philadelphia, PA. 🎉

After nearly 20 years, RailsConf 2025 will be the last gathering of its kind — a tribute to the incredible legacy of Rails and the community members who have been on this journey with us.

As part of a strategic shift, RailsConf 2025 will be the only conference hosted by Ruby Central in 2025. This means there will be no RubyConf in 2025, but we are looking forward to RubyConf 2026, which will take place in the spring and become our flagship event. 

By concentrating on one conference per year, we can create a truly best-in-class…

RubyGems Blog 

November 2024 RubyGems Updates

Welcome to the RubyGems monthly update! 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 November.

RubyGems News

In November, we released RubyGems 3.5.23 and Bundler 2.5.23. These releases bring a series of enhancements and bug fixes designed to improve the overall developer experience with RubyGems. Notable improvements include validating the user input encoding for gem CLI arguments and ensuring the--enable-load-relative binstubs prolog works correctly when Ruby is not installed in the same directory as the binstub. Additionally, we updated the --ext=rust

Some other…

Awesome Ruby Newsletter 

💎 Issue 448 - Ruby Video – On a mission to index all Ruby conferences

Ruby Central 

Ruby Central Supports RubyInstaller’s Expansion to ARM64

Ruby Central Supports RubyInstaller’s Expansion to ARM64

At Ruby Central, we’re proud to support projects that make open source more accessible to developers around the globe. One such initiative is RubyInstaller, an essential tool for building Ruby applications on Windows machines. 

RubyInstaller provides developers with a simple and seamless way to install Ruby on Windows, bundling the Ruby language, libraries, and development tools into a single package. RubyInstaller also includes RubyGems and the DevKit, ensuring that developers have everything they need without the complex setup that would otherwise be required on Windows.

During RubyConf in November, we learned that Lars Kanis, the maintainer of RubyInstaller, had launched a GoFundMe…

Bundler Blog 

Bundler v2.6: lockfile checksums are finally there

We’re happy to announce Bundler 2.6, featuring gem checksum verification, right in the Gemfile.lock file.

This feature has actually been implemented for more than a year. However, it was merged very close to the Bundler 2.5 release and we did not yet have a good plan for enabling the feature in a graceful manner, so we’ve kept it hidden until now.

Bundler 2.6 finally officially allows to opt-in into this beta feature.

What’s this feature for?

A lockfile is an easy way to ensure all environments will use a consistent version of every dependency. However, Bundler lockfiles did not protect from potential tampering of the sources of that specific version. This is what the this feature does.…

code.dblock.org | tech blog 

Harvesting the Low Hanging Fruit in Open Source Projects

Every active open-source project grows a lot of low hanging fruit. Encouraging project users to harvest some of the yield can be a great way to engage and retain new contributors. Here are some ideas, mostly borrowed from Barani, for low-hanging work items that you can propose to anyone engaging in your project.


Help Wanted, Good First Issue and Summer of Code

Identify and tag issues that have an easy solution to attract first time contributors.

Good first issues, or issues that are part of programs such as Summer of Code, provide an entry point for new contributors who want to get involved with the project, but are intimidated or unsure where to start. These issues are typically…

code.dblock.org | tech blog 

Do Not Fix Bugs Reported in Your Open Source Projects

Have you watched The IT Crowd? It’s a hilarious British television sitcom from around 2006 that cast a bunch of IT geniuses at the Reynholm Industries tech support department in London. One of the signature laughs is that every time the phone rang, Roy would pick it up and without waiting say “Have you turned it off and on again?”, then hang up. I often feel like Roy when engaging with users reporting bugs in open-source projects I maintain.

Here’s my structured approach for any bug being reported in my open-source projects.

  1. Do not fix the bug. Because this is open source, and we are not selling software, maintainers may have some social responsibility, but are under no obligation to…
Saeloun Blog 

What Is New In Ruby 3.4

It’s official, Ruby 3.4 first release is available, bringing a wave of excitement to the Ruby community.

In this blog, we will go through the latest features, enhancements, and bugfixes introduced in the Ruby 3.4

Prism is the new default parser

Ruby 3.4 switches the default parser from parse.y to Prism, which was introduced in Ruby 3.3 as a new parser designed for better maintainability, error tolerance, and performance.

To use the conventional parser, use the command-line argument --parser=parse.y. Feature #20564.

Garbage Collection

Ruby 3.4 introduced several notable features and enhancements related to its garbage collection (GC) system, aimed at improving performance and…

Rails Designer 

Use Tailwind CSS with Your Rails Forms

Rails’ Form Builder gives a great interface to easily build extensive forms. But a common issue many Rails developers using Tailwind CSS stumble upon, is styling their text_field’s, text_area’s and check_boxes’. There are multiple solutions:

  1. copy all Tailwind’s classes around;
  2. using Tailwind’s @apply directive and add a (vanilla) class, eg. input to the form field;
  3. create custom components (using ViewComponent) for each field type.

Option 2 was my go-to solution for a long time. Reusable, easy to make changes and simple enough to apply. But when I was working on my next SaaS, I started to explore a new option: a custom form builder.

What is a Form Builder?

Rails Form Builder…

Ruby Weekly 

Rails unveils some official merch

#​731 — December 19, 2024

Read on the Web

🎄 A mixed bag this week as we cover a few news items but then get into a 2024 roundup of Ruby news and the most clicked items of the year, in case you missed them at the time.

We're taking a Christmas break for two weeks and will be back on January 9, 2025, so we hope you have a Merry Christmas and a Happy New Year!
__
Peter Cooper and the Cooperpress team

Ruby Weekly

A Fresh Getting Started with Rails Tutorial — By way of the Rails Foundation, investments have been made in Rails 8.0 learning materials, starting off with this revamped ‘getting started’ guide, covering…

Notes to self 

Cannot connect to the Docker daemon after switching to OrbStack

Switching from Docker Desktop to OrbStack and stuck at Docker daemon error? Here’s how to fix it

When Kamal cannot connect

$ kamal build
ERROR: Cannot connect to the Docker daemon at unix:///Users/[user]/.docker/run/docker.sock

Luckily the fix is simple. We can recreate Kamal builder setting:

$ kamal build create

And that’s it!

Ruby on Rails 

2024 Wrap Up from the Rails Foundation

It’s amazing how quickly a year flies by.

It’s a total cliché, but it feels like only a few days ago that I sat by my Christmas tree and wrote last year’s final reflection post.

Back then, I was excited for all of the plans the Rails Foundation had in the works for 2024. Rails 7.1 was just released and already Rails 8 was on the horizon. There was so much to do! Documentation! Tutorial! Videos! Toronto! Merch store! Case studies! I couldn’t wait to hit the ground running and start assembling the teams to make all this happen.

…Then the motherboard in my new laptop died and I was forced to take the next week off until Apple provided a new one. I’m sure there was a ‘blessing in disguise’…

justin․searls․co - Digest 

🔗 My dad's obituary

Fred Searls

My dad, Fred Searls, passed away suddenly on Sunday night. Fortunately, my wife Becky, my brother Jeremy, and I were able to get on a flight to Detroit Monday to be with our mother Deanna and start making arrangements.

We worked together to draft this obituary, and it just went live on the funeral home's website (which is how people do it these days, apparently).

Here's the middle part that's actually about the person:

After earning his D.D.S. from Northwestern University Dental School, Fred practiced dentistry in Trenton, where he served patients with care and compassion for over forty-five years. In 1997, he and his family moved to Saline, where Fred’s warmth and generosity quickly made…

Fullstack Ruby 

A Casual Conversation with KOW (Karl Oscar Weber) on Camping, Open Source Politics, and More

This is a right humdinger of an episode of Fullstack Ruby! I got the chance to talk with Karl Oscar Weber all about the Camping web framework, as well as his Grilled Cheese livestream, working as a freelancer, and how to criticize by creating as a programmer in a world fraught with political upheaval. Great craic, as the Irish say.

Links & Show Notes:


Become a part of the Fullstack Ruby community and learn how to put your Ruby skills to work on the backend AND the…

Giant Robots Smashing Into Other Giant Robots 

Zero-downtime with Rails credentials part II

This post is part of the Zero-downtime with Rails credentials series.

In the first post we talked about the reasons that moved us towards making a codewide change and adopt Rails credentials rather than using environment variables to manage our secrets.

In this article we are going to look at the consequences, and the impact that these have on you as a developer, and your codebase.

What impact does this change have on you?

Credential files for each environment

It is important to conceptually consider all the environments we run the application in. In our case, these are:

  • development
  • test
  • staging
  • production

Not all of these environments may deploy to a server,…

byroot’s blog 

Optimizing Ruby’s JSON, Part 2

In the previous post, I covered my motivations for improving ruby/json’s performance, and detailed the first 4 notable optimizations applied to speed up JSON generation.

If I was to cover every single optimization applied, at this rate I’d end up with a dozen parts, so I’ll try to only focus on the one that made a significant difference or used an interesting pattern.

Reducing Setup Cost - Argument Parsing Edition

As mentioned in Part 1, When your benchmark only serializes a few dozen bytes of JSON, you end up measuring the baseline overhead of operations needed before you get to the actual work you’re here to perform, what I call “setup cost”.

The very high setup cost of ruby/json

37signals Dev 

Announcing Hotwire Spark: live reloading for Rails applications

Today, we are releasing Hotwire Spark, a live-reloading system for Rails Applications.

Reloading the browser automatically on source changes is a problem that has been well-solved for a long time. Here, we wanted to put an accent on smoothness. If the reload operation is very noticeable, the feedback loop is similar to just reloading the page yourself. But if it’s smooth enough — if you only perceive the intended change — the feedback loop becomes terrific.

To use, just install the gem in development:

group :development do
  gem "hotwire-spark"
end

It will update the current page on three types of change: HTML content, CSS, and Stimulus controllers. How do we achieve that desired…

Nithin Bekal 

What’s new in Ruby 3.4

A new version of Ruby is released every year on Christmas day. The 3.4 release will be out next week, so I’ve been playing around with the release candidate. Here are some of the features I found interesting.

(As an aside, I just realized that this is the 10th year in a row that I’ve written one of these “what’s new in Ruby” recaps!) 🎉

🧱 it - the default block parameter

Ruby introduced numbered block parameters 5 years ago in version 2.7. This allowed us to use _1, _2 etc instead of explicit block parameters. Now, a new variable called it has been added to refer to the default block parameter. This can be handy when chaining multiple operations:

isbn.gsub("-", "")
  .then { URI.parse("#{
Ruby on Rails 

Introducing the new Docs landing page

Last week, we published a bunch of new and updated resources to help you learn Rails and learn how companies leverage Rails to build successful businesses. But we also made a few structural and navigational changes to the website that you may not have noticed (yet).

The challenge: lots of resources, little space

Earlier this year, we had big plans:

  • Create a new flagship tutorial (with more planned soon).
  • Extract the Rails installation instructions from the tutorial into a standalone Installation Guide (because you shouldn’t have to find this information buried in chapter 3 of a tutorial).
  • Publish the first case study (with more planned soon).
  • On top of all that, launch a merch…

We were excited that all this was coming, but the navbar was already quite crowded…where were all these new resources going to live?

The solution: a unified Docs landing page

Introducing Docs, the friendly new starting point for everything you need to install Rails, learn it, get better…

RubyGems Blog 

3.6.1 Released

RubyGems 3.6.1 includes enhancements, bug fixes and documentation.

To update to the latest RubyGems you can run:

gem update --system

To install RubyGems by hand see the Download RubyGems page.

## Enhancements:

  • Installs bundler 2.6.1 as a default gem.

## Bug fixes:

  • Fix gem info tagging some non default gems as default. Pull request #8321 by deivid-rodriguez

## Documentation:

  • Fix broken links. Pull request #8327 by st0012

SHA256 Checksums:

  • rubygems-3.6.1.tgz
    ac455588155a52a6ecd9aeb43f9fc3099c004838172401d4e8388724c52d22ef
  • rubygems-3.6.1.zip
    efe8b01f3cbbed533f4e791eda4bbd36e1165c95e478b7ca903ce27b47948760
  • rubygems-update-3.6.1.gem
    fae1597ff2d479939a81a4b9d57c39b4…
Evil Martians 

Ease and epiphany: 4 ways to stop misguided dev tools user onboarding

Authors: Gleb Stroganov, Product Designer, Travis Turner, Tech Editor, and Roman Shamin, Head of DesignTopics: Design, User Interface Audit

Dev tool users don’t need the typical onboarding process, period. Let’s share fundamentals and tips on how we help users reach ultimate productivity ASAP!

Developer tool users don’t need the typical onboarding process, period. That is, we don’t need to walk through a collection of features, buttons, or other well-worn ideas. Instead, dev tools users need help getting up to speed with a tool as quickly, efficiently, and painlessly as possible. For developer tool designers, that means we’re looking to help our users reach an “a-ha moment” as soon as…

BigBinary Blog 

How to remotely EV code-sign a windows application using ssl.com

Recently, we built NeetoRecord, a loomalternative. The desktop application was built using Electron. In a series ofblogs, we capture how we built the desktop application and the challenges we raninto. This blog is part 9 of the blog series. You can also read aboutpart 1,part 2,part 3,part 4,part 5,part 6,part 7and part 8.

Code-signing allows Windows to verify the identity of an application'spublisher, making it authentic and trustworthy. Additionally, code-signing helpsapplications comply with Windows security policies, avoiding warnings andinstallation blocks, ultimately building user confidence and providing asmoother, safer experience.

What is code-signing?

At its core, code-signing…

Ruby Magic by AppSignal 

AppSignal’s Top 5 Ruby Posts in 2024

As the year draws to an end, we're excited to share our top five most-read Ruby articles of 2024, in reverse order:

Top 5 Ruby Blog Posts in 2024 💎

What's Coming in Ruby on Rails 7.2: Database Features in Active Record

Taking a look at some noteworthy changes in Ruby on Rails 7.2, particularly in Active Record.

Hotwire Modals in Ruby on Rails with Stimulus and Turbo Frames

In the first part of this series, we explore two Hotwire methods to make modals accessible in your Rails application.

Should You Use Ruby on Rails or Hanami?

We updated this smash post from 2023 to clarify some differences in models and data persistence between Rails and Hanami.

Five Things to Avoid in Ruby

In this…

John Nunemaker 

Episode #2

Episode #1 went out last Thursday. Now here we are on Tuesday and ANOTHER EPISODE FOR YOU. I know right?! Christmas came early this year.

On today's episode, we hit on a few topics:

🙋 Customer feedback.
😖 Podcasting pains.
🆕 Future features.
🏆 Recent wins.

Just hit play... you know you want to. And then be sure to subscribe.

In the interest of getting better, we're improving something each episode. Today's improvement was a wee bit of intro/outro music.

Rails Designer 

Introducing Rails UI Audit

Over the last year, since I launched Rails Designer, I’ve been approached many times every month by teams around the world to help them with their Rails app’s UI and UX as a product engineer. I’ve since packaged this offering in something called Tailor Made UI.

I can only commit to a few of these requests—my time is limited. But another thing that came up at times; they didn’t all need a hands-on product engineer to do the work. They sometimes only want a professional’s eye to look over their app and give tips, ideas and guidance.

So I am introducing Rails UI Audit. ✨

It’s a productized-service, where I, a designer turned developer with over 20 years of professional experience go over…

These insights will then,…

Short Ruby Newsletter 

Short Ruby Newsletter - edition 118

The one where Rails publishes so many goodies for the community and Ruby announces 3.4.0 release candidate
The Bike Shed 

451: Making Time for and Managing Focus

It’s officially the holidays at the Bike Shed! Defrag your hard drives and take a break with Joël and Stephanie as they breakdown different ways to manage your focus during the day.

The pair discuss separating coding time from thinking time when working, the pros and cons of blocking out time for different tasks and clever ways to move seamlessly from one project to the next without losing momentum.

Joël has some more timezone facts to share, while Stephanie reveals her worst enemy when it comes to productivity.

Try out the Pomodoro system in your workflow and let us know if it works for you!

Your hosts for this episode have been thoughtbot’s own Stephanie Minn and Joël…

Nithin Bekal 

Review: Galaxy Watch 7 Ultra

When my 5 year old Galaxy Watch Active2 finally gave out this year, I decided to wait a couple of months for Samsung’s announcement of the 7 series watches. The wait paid off with both Watch 7 and Ultra being great updates to the lineup. The Galaxy series still remains the best option if you’re in the Android ecosystem.

In the end, I picked up the Ultra model. The larger screen, durability and battery capacity swayed me in its favor. But truth be told, the Watch 7 is the stronger contender, with most of the same features at less than half the price.

Display

The 47mm screen size does feel a tad large on my wrist, and the watch is also quite thick, which makes it feel bulkier. It’s a bit…

Gusto Engineering - Medium 

Gusto’s Investment in Open-Source Communities

Co-Authors: Jon Evans, Mangesh Tamhankar, Namrata Jain

Neon signage of a human handshake

Gusto is built on a foundation of open-source software. These technologies power our product, enhance privacy and security, drive innovation, and help us reduce cost. Many of these tools that we depend on are maintained by dedicated volunteers, often without financial support.

Here at Gusto, we would like to contribute to the continual maintenance of these open-source software by supporting the people and communities that power this software. We’re happy to share that Gusto now has an open-source community funding budget! This initiative reflects our gratitude and commitment to the people and communities whose work powers the technologies…

Posts on Kevin Murphy 

2024 Year-End Review

This isn’t a “real” post. This is a summary of all the things that made up my year in 2024 (almost all in a professional context). Thanks to all who were a part of it.

Writing 🔗

I published 7 articles about Ruby or software development in general this year. The first was about possible RailsConf tracks. My last post of the year covered what I saw at RubyConf.

In between conference posts, I wrote about Sidekiq batches, accessing request headers in Rails, and RSpec stubbing.

I continue sending my posts to newsletter subscribers. You can still subscribe via RSS or try to keep up wherever I post on social media.

My most-read posts are those that end up in other newsletters. This year, my writing…

Ruby on Rails 

The official Rails merch store is live

It’s been a long time coming, many of you have asked for it, and now the wait is over. Today the official Rails merch store launches in the United States and Canada!

Explore the first collection here.

The first collection is simple and classic: high-quality and comfortable t-shirts and hoodies, a travel mug, a cap, and a Rails baby onesie for your tiny future programmer. But this is just the beginning. Stay tuned for more designs and items coming soon.

By wearing Rails merch, you’re not just showing support for Rails as a framework; you’re also celebrating being part of an open-source community that has continued to thrive for more than two decades.

We can’t wait to see you out in the…

RubyGems Blog 

3.6.0 Released

RubyGems 3.6.0 includes security, breaking changes, features, enhancements, bug fixes and documentation.

To update to the latest RubyGems you can run:

gem update --system

To install RubyGems by hand see the Download RubyGems page.

## Security:

  • Stop storing executable names in ivars. Pull request #8307 by segiddins

## Breaking changes:

  • Drop ruby 3.0 support. Pull request #8091 by segiddins

## Features:

  • Add –attestation option to gem push. Pull request #8239 by segiddins

## Enhancements:

  • Skip unresolved deps warning on Gem::Specification.reset on benign cases. Pull request #8309 by deivid-rodriguez
  • Let gem install <name> suggest <name>-ruby and ruby-<name>
Evil Martians 

Railsmas on Mars: 12 Days of Mandatory Developer Joy and Challenge

Authors: Svyatoslav Kryukov, Backend Engineer, Artur Petrov, Backend Engineer, and Travis Turner, Tech EditorTopics: Backend, Ruby on Rails, Ruby

Over 12 days, we’ll unwrap 12 small (but mighty) approaches designed to level up your Rails apps. We’ll discuss, then suggest hands-on practice!

As the holidays near, it's time to give yourself (and your team) the gift of a happier development experience! So, over 12 days, we'll unwrap 12 small (but mighty) approaches designed to level up your Rails apps. We'll discuss, then suggest hands-on practice. These bite-sized tasks are designed to be completed in under an hour. They'll need to be quick if we're going to convince Santa to make the switch…

The Rails Tech Debt Blog 

What is cyclomatic complexity and why you should care

Many times, when looking at applications we have written or that we see around in repositories throughout the internet, we get this feeling that whatever we’re reading has a certain complexity too it. Sometimes this complexity is manegeable and expected. Sometime it’s not. Actually, very frequently, code can be difficult to understand and we usually describe such code as being overcomplicated, for example.

But it’s not just our understanding of written code that suffers. As expected, if code is more complex, it will also require more effort on the part of the computer to execute. And while efficient code might not necessarily be easy to understand, there is indeed such a possibility as…

Ruby Rogues 

Sorbet with Ufuk Kayserilioglu - RUBY 664

In this episode of Ruby Rogues, we talk with Ufuk about how Shopify made the transition to using Sorbet and about the benefits they felt they received from implementing it. Ufuk also reveals a little bit about how Shopify transitioned to fully remote and about how that will be the default moving forward.

Picks  


Become a supporter of this podcast: https://www.spreaker.com/podcast/ruby-rogues--6102073/support.
Josh Software 

From Desk to Destination

Hi there, I want to talk about something very close to my heart: traveling. For me, traveling is not just a way to explore new places but a key ingredient in maintaining a healthy work-life balance. It rejuvenates my mind, enhances my productivity, and strengthens my perspective on life. My Traveling Habits I’ve always been passionate … Continue reading From Desk to Destination
Rails Designer 

Announcing Stimulus FX

Recently I published an article about custom action options in Stimulus. It explains how you can use these to build more advanced actions with custom JavaScript. It’s pretty neat, check out the article if you want to know more!

While writing the article and reviewing my own apps for examples, I noticed I frequently repeated the same custom action options. As a developer, that kind of repetition started to make me uneasy. So I decided what every sane developer would decide: package them up! 📦 😬

So here is: Stimulus FX. It’s also on GitHub and NPM.

Usage is simple. After adding the package using your favorite tool, all you need is:

// Import everything
import { registerActionOptions } from
Giant Robots Smashing Into Other Giant Robots 

Testing SQL queries in a Ruby service

The part where our hero thinks everything is fine

Recently, I worked on a project where we needed to build a Ruby service that would run queries on a third party database and send the results to our main Rails application. The third party database was a huge MSSQL database with tons of data, but we were only using a handful of tables. As I started building the service, I wrote specs for the Ruby code, but mocked all the database calls to return predefined data. This gave me confidence that my Ruby code worked, but the core purpose of the service was querying the database, and that was entirely untested.

The part where our hero realizes everything is not, in fact, fine

I threw a ‘write SQL tests’ card in the tech debt backlog and carried…

justin․searls․co - Digest 

📄 How to transcribe a Podcast with Whisper on an ARM Mac using Homebrew

Goofing around with podcast transcripts today. Here's what I did to transcribe version 26 of the Breaking Change podcast, after a couple hours of being mad at how hard the Internet was making it:

  1. Run brew install whisper-cpp, because I'm fucking sick of cloning one-off Python repos.
  2. Download a model and put it somewhere (I chose ggml-large-v3-turbo-q8_0.bin because it's apparently slower but more accurate than "q5", whatever the hell any of this means)
  3. Since your podcast is probably an MP3, you'll have to convert it to a WAV file for Whisper. Rather than create an interstitial file we'd have to clean up later, we'll just pipe the conversion from ffmpeg. That bit of the command looks like:
byroot’s blog 

Optimizing Ruby’s JSON, Part 1

I was recently made maintainer of the json gem, and aside from fixing some old bugs, I focused quite a bit on its performance, so that it is now the fastest JSON parser and generator for Ruby on most benchmarks.

Contrary to what one might think, there wasn’t any black magic or deep knowledge involved. Most of the performance patches I applied were fairly simple optimizations driven by profiling. As such, I’d like to go over these changes to show how they are quite generic and that many don’t only apply to C code.

But before I dive into these, let me explain why I came about working on this in the first place.

There Should Be No Need For Alternatives

My motivation was never really…

Hotwire Weekly 

Week 50 - Turbo morphing woes, 10 Hotwire Native tips, and more!

Hotwire Weekly Logo

Welcome to Hotwire Weekly!

Welcome to another issue of Hotwire Weekly! Happy reading! 🚀✨


📚 Articles, Tutorials, and Videos

Keeping Rails cool: the modern frontend toolkit - Irina Nazarova wrote an article on the Evil Martians blog and presents a comprehensive guide for startups using Rails, focusing on enhancing frontend development productivity. They advocate for integrating tools like Hotwire and Inertia.js to streamline development and improve user experience.

10 tips from 10 years of Hotwire Native - Joe Masilotti shares insights from a decade of experience with Hotwire Native (formerly Turbo Native and Turbolinks).

Turbo morphing woes - Matheus Richard discusses challenges…

AkitaOnRails.com 

Refletindo Sobre Alcance de Redes Sociais

Este artigo não tem a pretensão de ser um guia completo sobre o assunto "alcance", só algumas coisas que estavam na minha cabeça e que eu queria dar um "dump".

Posso dizer que eu entendo alguma coisa sobre redes sociais, tendo começado desde que redes sociais começaram. Minha conta do X/Twitter era de 2007, eu literalmente conheci alguns dos programadores originais do Twitter original. Minha conta chegou a quase 84 mil seguidores, quase 70 mil no Instagram, mais de 150 mil no LinkedIn, quase 500 mil no YouTube, tudo do zero, tudo sem nenhuma grande empresa por trás, nem nenhum patrocínio, tudo puramente orgânico. Acho que eu sei uma coisa ou duas sobre isso.

Não é tão difícil crescer seu…

AkitaOnRails.com 

Refletindo Sobre Alcance de Redes Sociais

Este artigo não tem a pretensão de ser um guia completo sobre o assunto "alcance", só algumas coisas que estavam na minha cabeça e que eu queria dar um "dump".

Posso dizer que eu entendo alguma coisa sobre redes sociais, tendo começado desde que redes sociais começaram. Minha conta do X/Twitter era de 2007, eu literalmente conheci alguns dos programadores originais do Twitter original. Minha conta chegou a quase 84 mil seguidores, quase 70 mil no Instagram, mais de 150 mil no LinkedIn, quase 500 mil no YouTube - que, mesmo sem postar video novo o ano inteiro, ainda trouxe mais de 3 milhões de views -, tudo do zero, tudo sem nenhuma grande empresa por trás, nem nenhum patrocínio, tudo…

AkitaOnRails.com 

Refletindo Sobre Alcance de Redes Sociais

Este artigo não tem a pretensão de ser um guia completo sobre o assunto "alcance", só algumas coisas que estavam na minha cabeça e que eu queria dar um "dump".

Posso dizer que eu entendo alguma coisa sobre redes sociais, tendo começado desde que redes sociais começaram. Minha conta do X/Twitter era de 2007, eu literalmente conheci alguns dos programadores originais do Twitter original. Minha conta chegou a quase 84 mil seguidores, quase 70 mil no Instagram, mais de 150 mil no LinkedIn, quase 500 mil no YouTube, tudo do zero, tudo sem nenhuma grande empresa por trás, nem nenhum patrocínio, tudo puramente orgânico. Acho que eu sei uma coisa ou duas sobre isso.

Não é tão difícil crescer seu…

AkitaOnRails.com 

Refletindo Sobre Alcance de Redes Sociais

Este artigo não tem a pretensão de ser um guia completo sobre o assunto "alcance", só algumas coisas que estavam na minha cabeça e que eu queria dar um "dump".

Posso dizer que eu entendo alguma coisa sobre redes sociais, tendo começado desde que redes sociais começaram. Minha conta do X/Twitter era de 2007, eu literalmente conheci alguns dos programadores originais do Twitter original. Minha conta chegou a quase 84 mil seguidores, quase 70 mil no Instagram, mais de 150 mil no LinkedIn, quase 500 mil no YouTube, tudo do zero, tudo sem nenhuma grande empresa por trás, nem nenhum patrocínio, tudo puramente orgânico. Acho que eu sei uma coisa ou duas sobre isso.

Não é tão difícil crescer seu…

AkitaOnRails.com 

Refletindo Sobre Alcance de Redes Sociais

Este artigo não tem a pretensão de ser um guia completo sobre o assunto "alcance", só algumas coisas que estavam na minha cabeça e que eu queria dar um "dump".

Posso dizer que eu entendo alguma coisa sobre redes sociais, tendo começado desde que redes sociais começaram. Minha conta do X/Twitter era de 2007, eu literalmente conheci alguns dos programadores originais do Twitter original. Minha conta chegou a quase 84 mil seguidores, quase 70 mil no Instagram, mais de 150 mil no LinkedIn, quase 500 mil no YouTube, tudo do zero, tudo sem nenhuma grande empresa por trás, nem nenhum patrocínio, tudo puramente orgânico. Acho que eu sei uma coisa ou duas sobre isso.

Não é tão difícil crescer seu…

AkitaOnRails.com 

Refletindo Sobre Alcance de Redes Sociais

Este artigo não tem a pretensão de ser um guia completo sobre o assunto "alcance", só algumas coisas que estavam na minha cabeça e que eu queria dar um "dump".

Posso dizer que eu entendo alguma coisa sobre redes sociais, tendo começado desde que redes sociais começaram. Minha conta do X/Twitter era de 2007, eu literalmente conheci alguns dos programadores originais do Twitter original. Minha conta chegou a quase 84 mil seguidores, quase 70 mil no Instagram, mais de 150 mil no LinkedIn, quase 500 mil no YouTube, tudo do zero, tudo sem nenhuma grande empresa por trás, nem nenhum patrocínio, tudo puramente orgânico. Acho que eu sei uma coisa ou duas sobre isso.

Não é tão difícil crescer seu…

justin․searls․co - Digest 

🎙️ Breaking Change podcast v26 - Luigi's Mansion

Direct link to podcast audio file

I'd write more here, but I've got places to be. Becky, Jeremy, and I are going to engage in some holiday festivities. We have a couple gingerbread houses to make and a tree to trim. And no nog to speak of. Really, that's all you get by way of show notes this time as a result, deal with it.

Send your complaints to podcast@searls.co and they will be read on air.

Some bullet points below the fold:

code.dblock.org | tech blog 

How to Grow Open-Source Contributors and Maintainers

I’ve been very active in open source since around 2008 and have become very passionate about growing contributors and maintainers in the projects I am involved in. The health of an open-source project can easily be measured by the number of actively engaged participants in its code, which cannot happen without maintainers. Maintainers are leaders driving open-source projects. The best maintainers contribute significant code, have the responsibility to review other people’s contributions, and perform the release process. In my experience, the best ones are experts in the system they are developing. They are prolific coders, and are able to collaborate with contributors that don’t work for…

Ruby on Rails 

New Rails Tutorial and Unpacked Videos, Releases, ActiveModel::Attributes::Normalization and more!

Hey everyone, Happy Saturday!

Vipul here with the latest updates for This Week in Rails. Let’s dive in!

This week, the Rails Foundation released a series of updated resources to help you learn the new Rails 8 defaults, including a brand new Getting Started Tutorial, a 9-part video series on YouTube, and updated Rails Guides.

Read the announcement here. The Installation Guide has also been decoupled so it is easier to find, and includes the basics of installing Ruby with a version manager - arguably one of the biggest barriers to newcomers.

Rails Versions 7.0.8.7, 7.1.5.1, 7.2.2.1, and 8.0.0.1 have been released!
These are security patches addressing one new issue where using the co…

Ruby on Rails 

Want to learn about Rails 8? START HERE.

Rails 8 is a major milestone, and for the first time in Rails’ history, thanks to the support of the members of the Rails Foundation, we are able to support this major release with new and updated tutorials, videos, and guides to help developers learn Rails’ new default features as quickly as possible.

If you want to learn more, here’s where you should start.

The (new) Getting Started Tutorial

The revamped Getting Started Guide walks you through building an e-commerce site while introducing Rails fundamentals and the latest Rails 8 defaults. Learn to use:

  • the built-in Authentication Generator to create an admin system for managing products.
  • Action Mailer, Active Job, and Solid Queue
Ruby on Rails 

Rails Version 8.0.1 has been released!

Hi everyone,

I am happy to announce that Rails 8.0.1 has been released.

CHANGES since 8.0.0

To see a summary of changes, please read the release on GitHub:

8.0.1 CHANGELOG To view the changes for each gem, please read the changelogs on GitHub:

Full listing

To see the full list of changes, check out all the commits on GitHub.

SHA-256

If you’d like to verify that your gem is the same as…

justin․searls․co - Digest 

📸 How to fill Apple Passwords without constant Face ID and Touch ID prompts

Having recently begun the long, arduous journey off 1Password and onto Apple Passwords, one of the biggest annoyances is how much friction it adds to the drudgery of signing into a service to have to reach behind my monitor to scan the Touch ID sensor or to ensure I’m sufficiently camera-ready for a Face ID check to pass.

Turns out, you can just turn this off altogether! I would have preferred a reasonable time-based settings like 30 minutes or an hour, but I expected the answer to be, "go pound sand," and this is indeed better than that.

Ruby Central 

Ruby Central Welcomes Chelsea Kaufman as Transitional Executive Director

Ruby Central Welcomes Chelsea Kaufman as Transitional Executive Director

Ruby Central is excited to announce that Chelsea Kaufman is taking on the role of transitional Executive Director. Kaufman is stepping in to guide the organization through a pivotal time of growth and is leading the search for the next permanent Executive Director. For the past two years, she has served as Ruby Central’s Board President and is stepping down from the board to assume this role. 

Kaufman is taking over from Adarsh Pandit, who has served as interim Executive Director since May 2023. Pandit led the organization through a period of shifting industry dynamics, marked by pandemic-era impacts on events and economic challenges affecting the tech industry. His leadership has been…

Posts on Kevin Murphy 

Frequently Played Dec 2024

Frequently Played 🔗

I tend to listen to the same songs or albums on repeat that are evocative of how I’m feeling or what’s going on with me. Here is what I’m currently listening to over, and over, and over, and over, again.

The River 🔗

Bruce is my favorite storyteller. He speaks to me. Helps me understand stories beyond my own, while also making sense of things in my life.

Full Lyrics

Now those memories come back to haunt me
They haunt me like a curse
Is a dream a lie if it don’t come true?
Or is it something worse?

Get Hurt 🔗

This blog isn’t the first time The Gaslight Anthem and Bruce Springsteen got together. Not the latest official time either.

Full Lyrics

Have you come to take her away from me?
Fro…

DotRuby - Things we have to say. 

How to Customize Rails Form Error Handling

If you've worked with Rails forms, you've likely encountered the infamous `.field_with_errors wrapper`. While it's designed to help highlight invalid fields, it can wreak havoc on your HTML structure and CSS styles. Fear not — there's an easy way to disable it!
Saeloun Blog 

Rails 8 Adds if_not_exists Option On The add_enum_value.

Rails 7 added support for custom enum types in PostgreSQL with introduction of create_enum to add a new enum type and t.enum to add a column.

Rails 7.1 has extended the ability to rename an enum, add enum value and rename enum value for the Postgres database adapter.

The add_enum_value method provides a straightforward way to add new values to a PostgreSQL enum type without needing to execute raw SQL.

class AddEnumToArticles < ActiveRecord::Migration[7.2]
  def change
    create_enum :status, ["draft", "published", "archived", "trashed"]

    safety_assured do
      change_table :articles do |t|
        t.enum :current_status, enum_type: "status", default: "draft", null: false
      end
class AddReviewToArticleStatus < ActiveRecord::Migration[7.2]
  def change
    add_enum_value :status, 'review'
  end
end

Before

When we use add_enum_value, PostgreSQL checks for duplicates and raises a PG::Duplic…

Giant Robots Smashing Into Other Giant Robots 

Why should I avoid regular expressions?

In my experience, most developers dread working with regular expressions, but I love them. I enjoy using their dense syntax to write expressive patterns that solve all sorts of cool challenges. I use them every day: on the command line with grep and sed, in my editor’s search-and-replace tool, in crosswords, and of course in production code.

But their power must be carefully wielded, because it’s very easy to introduce unexpected false positives. Let’s take a look at a regular expression that demonstrates this danger and talk about how to fix it.

An example of a bad regular expression

Imagine that you’re implementing a commenting feature for a well-regarded tech blog. Users…

Jardo.dev: Blog 

Advent of Criminally Bad Ruby Code

Yesterday, Marco Roth and I committed a variety of Ruby programming felonies and are now fugitives from the Rubocops. Marco joined my Twitch stream where I was working on the fifth day of this year’s Advent of Code. He had some very good ideas about how to tackle the problem. I was keen to try them out.

Mild Advent of Code Spoilers This blog post is focused on the features of Ruby that we used, not the puzzle itself. There will be some allusions to the Advent of Code puzzle, but the code is so obfuscated that this likely won’t seriously spoil the solution for you. Viewer discretion is advised.

Smooth Operators

My goal for the session was to override some operators. Ruby let’s you…

justin․searls․co - Digest 

📸 It's Thursday I still need these

Record scratch you're probably wondering how I got here.

Awesome Ruby Newsletter 

💎 Issue 447 - Keeping Rails cool: the modern Evil Martians frontend toolkit

Fullstack Ruby 

Tired of Dealing with Arguments? Just Forward Them Anonymously!

I don’t know about you, but after a while, I just get tired of the same arguments. Wouldn’t it be great if I could simply forward them instead? Let somebody else handle those arguments!

OK I kid, I kid…but it’s definitely true that argument forwarding is an important aspects of API design in Ruby, and anonymous argument forwarding is a pretty awesome feature of recent versions of Ruby.

Let’s first step through a history of argument forwarding in Ruby.


Pedantic Ruby Question: Are they called method arguments, or method parameters? And when are they called arguments and when are they called parameters? And are keyword arguments also called named parameters?! I’m not entirely sure.…

Ruby on Rails 

Introducing the first Rails case study: Doximity’s Journey with Rails

Today, the Rails Foundation is releasing the first of many case studies that will showcase how companies use and build with Rails. To kick off this series, we’re highlighting the story of why Doximity chose Rails in 2010, and how they’ve been building and scaling their original monolith successfully for the past 15 years.

Doximity is the leading digital platform for U.S. medical professionals. Their mission is to help doctors provide better care to their patients by providing tools that help streamline communication, collaboration, and clinical workflow, including telehealth. Over the past 15 years, they’ve grown to serve more than two million healthcare professionals, including more than…

Julia Evans 

"Rules" that terminal programs follow

Recently I’ve been thinking about how everything that happens in the terminal is some combination of:

  1. Your operating system’s job
  2. Your shell’s job
  3. Your terminal emulator’s job
  4. The job of whatever program you happen to be running (like top or vim or cat)

The first three (your operating system, shell, and terminal emulator) are all kind of known quantities – if you’re using bash in GNOME Terminal on Linux, you can more or less reason about how how all of those things interact, and some of their behaviour is standardized by POSIX.

But the fourth one (“whatever program you happen to be running”) feels like it could do ANYTHING. How are you supposed to know how a program is going to behave?

Th…

Ruby Weekly 

Ruby 3.4 - almost!

#​730 — December 12, 2024

Read on the Web

Ruby Weekly

Ruby 3.4.0 Release Candidate 1 Released — Christmas is almost here, and that means the imminent release of Ruby 3.4. If you haven’t played with it yet, 3.4.0-rc1 is worth trying as it includes everything the final release will, including the switch over to the Prism parser (so certainly worth testing). We’ll do a full 3.4 rundown once it’s released, but this is a good early Xmas present for now.

Yui Naruse

Lightstorm: A Minimalistic Ruby Compiler — It’s not every week we get to hear of a new Ruby implementation or compiler, especially not on the…

37signals Dev 

A vanilla Rails stack is plenty

If you have the luxury of starting a new Rails app today, here’s our recommendation: go vanilla.

  • Fight hard before adding Ruby dependencies. Keep that Gemfile that Rails generates as close to the original one as possible.
  • Fight even harder before adding Javascript dependencies. You don’t need React or any other front-end frameworks, nor a JSON API to feed those.
  • Hotwire is a fantastic, pragmatic, and ridiculously productive technology for the front end. Use it.
  • The same goes for mobile apps: use Hotwire Native. With a hybrid approach you can combine the very same web app you have built with a wonderful native experience right where you want it. The productivity compared to a…
John Nunemaker 

Episode #1

We did it! The Fireside crew went through the entire process of setting up a podcast and recording our first episodes.

#1 is live wherever you enjoy podcasts (probably).

I never would have guessed how tedious it would be to get your first episode out the door. Now I have a ton of respect for our customers, especially our non-technical ones, who have made it through this gauntlet.

So much information to fill out! I'm looking forward to getting this process locked down so new episodes will be much easier. Also, planning to start paying for an editor. 🤣

We set the quality bar very low for this. We know we'll get better with each episode but we had to start somewhere. Enjoy!

And be sure to s…

SINAPTIA 

Tree structures in Rails

Tree structures are a common way of organizing hierarchical data. Each node in the structure has a parent node (except the root) and zero or more child nodes. Last month, as we started working on a new project in which the main entity is organized as a tree, we needed to analyze the existing solutions for tree structures in Rails’ ecosystem. In this post, we will explore those solutions, their benefits, drawbacks, and when to use them. Particularly, we’ll take a look at:

In all cases, once you set these plugins up, your model will be extended to access a node’s parent and children, ancestors, descendants, etc. and you’ll have a way of arranging…

Fractaled Mind 

Always use flex-wrap: wrap on flex containers

I spent a bit of time this morning make some improvements to sqlite.directory, and I found myself needing to make a number of fixes around the mobile responsiveness of the UI. So, I thought I would take a moment to catalog a few common patterns and tips I have found useful when working with responsive design. This first tip was one that I found myself using quite a bit today.


I use flex containers a ton; I love them. But, I find myself overlooking the same responsive detail time and time again—I don’t properly handle wrapping. Let’s take a real example from the sqlite.directory header:

See the Pen responsive design tip: flex-wrap (before) by Stephen Margheim (@smargh) on Cod…

As you can see, on a smaller screen, the…

Ruby News 

Ruby 3.4.0 rc1 Released

We are pleased to announce the release of Ruby 3.4.0-rc1.

Prism

Switch the default parser from parse.y to Prism. [Feature #20564]

Modular GC

  • Alternative garbage collector (GC) implementations can be loaded dynamically through the modular garbage collector feature. To enable this feature, configure Ruby with --with-modular-gc at build time. GC libraries can be loaded at runtime using the environment variable RUBY_GC_LIBRARY. [Feature #20351]

  • Ruby’s built-in garbage collector has been split into a separate file at gc/default/default.c and interacts with Ruby using an API defined in gc/gc_impl.h. The built-in garbage collector can now also be built as a library using mak…

justin․searls․co - Digest 

📸 How dare you judge me

I added string cheese to my cart, and this popped up.

Rails Designer 

Rails Icons 1.0.0 is here

After about 8 months and a modest multiple thousands downloads, Rails Icons 1.0.0 is here!

Rails Icons is a Rails gem to add (SVG) icons to your app. It is library agnostic so it can be used with any icon library using the same interface.

Simply like this:

<%= icon "check", class: "text-gray-500" %>

It uses the library you set as a default, which could be any from the first-party libraries supported: Feather, Heroicons, Lucide or Tabler. But icons from any other library can be added! Like the Apple logo from the Simple Icons library:

<%= icon "apple", library: "simple_icons", class: "text-black" %>

No icons included

Initially Rails Icons was released with all the icons included, but…

solnic.dev 

Retiring from the core teams

Today were announcing on the official Hanami blog that I am retiring from the core teams. Its a decision Ive made after about 2 years of contemplating how I want to move forward with my involvement with the Ruby community and its Open Source ecosystem.

As you can imagine, this decision has not been easy to make. I have a long history of working with Ruby and being an active member of its Open Source community. I will do my best to tell you why I made this decision, but first and foremost, this post is about the people who changed my life and a way of saying thank you. Let's start with that!

This is in somewhat chronological order:

  • Paul Klipp - thank you for believing in me back in 2007 when…

Hanami 

A new chapter for dry-rb and ROM

After 10 years working on dry-rb, and 15 years on DataMapper and now Ruby Object Mapper (aka ROM), Peter Solnica is retiring from the dry-rb and ROM core teams.

I’d like to extend my deepest thanks to Peter for all his contributions to Ruby open source software. As a co-founder of these projects, Peter has put thousands of hours into a body of work that has benefited the entire community and changed the way we think about Ruby.

Peter, my time with you has been one of the defining chapters of my Ruby life. I’ve cherished the opportunity to work and grow alongside you. Thank you for everything! ❤️

So what’s next for dry-rb and ROM? The work continues as usual. I’m still a committed…

Notes to self 

How to use a remote build server with Kamal

How and when to create an external build server for your Kamal deploys?

Remote build server

What’s a remote builder anyways? Kamal will build your Docker images locally by default (on your laptop or anywhere you run the kamal command), but you can choose to do the build on a different host by specifying the builder’s remote connection:

# config/deploy.yml
builder:
  arch: amd64
  cache:
    type: gha
  remote: ssh://root@164.92.229.121

Note that Kamal will continue to do local builds as long as the architecture of the local host matches your arch settings. To force a remote build set local to false:

# config/deploy.yml
builder:
  local: false
  remote: ssh://root@164.92.229.121

This…

RubyGems Blog 

RubyGems.org Completes First Security Audit With Trail of Bits

At Ruby Central, ensuring the security of RubyGems.org—the central hub for Ruby packages—is one of our top priorities. With over 184 billion downloads, RubyGems.org is crucial to the Ruby ecosystem, supporting developers, businesses, and open source projects worldwide.

To strengthen this critical infrastructure, we recently collaborated with Trail of Bits on our first security audit of RubyGems.org.

Trail of Bits is a leading cybersecurity firm that helps organizations identify vulnerabilities, enhance defenses, and implement security best practices.

The audit was funded through a grant from the Alpha-Omega Project, a consortium backed by Microsoft, Google, and Amazon, dedicated to…

RubySec 

CVE-2024-54133 (actionpack): Possible Content Security Policy bypass in Action Dispatch

There is a possible Cross Site Scripting (XSS) vulnerability in the `content_security_policy` helper in Action Pack. ## Impact Applications which set Content-Security-Policy (CSP) headers dynamically from untrusted user input may be vulnerable to carefully crafted inputs being able to inject new directives into the CSP. This could lead to a bypass of the CSP and its protection against XSS and other attacks. ## Releases The fixed releases are available at the normal locations. ## Workarounds Applications can avoid setting CSP headers dynamically from untrusted input, or can validate/sanitize that input. ## Credits Thanks to [ryotak](https://hackerone.com/ryotak) for the report!
Ruby on Rails 

Gusto joins the Rails Foundation as a Contributing member

We have a lot of good news coming this week, and this is just the start: Gusto, a leading provider of HR, payroll, and benefits solutions, and a big supporter of the Rails community, has joined the Rails Foundation as its newest Contributing member!

Gusto was founded in 2011 as ZenPayroll and rebranded in 2015 as they extended their focus from payroll to include health benefits and workers’ compensation services and more. Along the way, they have grown to around 3,000 employees with hundreds of Rails developers.

Gusto’s codebase is largely divided into two majestic monoliths. They’ve leaned into gradual modularization by adopting packwerk and have contributed to the surrounding…

The Ruby on Rails Podcast 

Episode 529: Catching Up With Nick Schwaderer

This episode is a little off the Rails, but it was still fun catching up with our co-host, Nick Schwaderer.

Fractaled Mind 

sqlite.directory updates

After the initial launch of sqlite.directory, I have been working on a few updates to the site. Here are some of the updates:

As of writing this (December 11, 2024 at 1:30 PM CET) there are 17 applications listed on the site. I am excited to see the site grow and to see more applications listed on the site. If you…

BigBinary Blog 

Using native modules in Electron

Recently, we built NeetoRecord, a loomalternative. The desktop application was built using Electron. In a series ofblogs, we capture how we built the desktop application and the challenges we raninto. This blog is part 8 of the blog series. You can also read aboutpart 1,part 2,part 3,part 4,part 5,part 6,part 7andpart 9.

Native modules allow developers to access low-level APIs like hardwareinteraction, native GUI components, or other system-specific features. BecauseElectron applications run across different platforms (Windows, macOS, Linux),native modules must be compiled for each target platform. This can introducechallenges in cross-platform development.

To simplify this process, Electron…

Mintbit 

Why You Should Consider Using excluding Instead of where.not in ActiveRecord

In Ruby on Rails, ActiveRecord simplifies working with databases, and where.not is a common way to filter out records based on a condition. However, in some cases, using excluding — introduced in Rails 7 — can be a better alternative. Here’s why.

What is where.not?

where.not is used to exclude records that meet a specific condition. For example, if you want to fetch all users except those with a certain email:

1
User.where.not(email: 'example@domain.com')

This is useful for excluding records based on specific conditions.

What is excluding?

excluding allows you to exclude specific records from a query. For example, to fetch all users but exclude a specific user:

1
2
user_to_exclude =
Evil Martians 

Keeping Rails cool: the modern frontend toolkit

Authors: Irina Nazarova, CEO, and Travis Turner, Tech EditorTopics: Business, Go, Ruby on Rails

We advocate and build for Rails startups, and we know this tech gives teams a productivity and competitive edge. But we also know what startups struggle with the most: frontend. Let's share our silver toolkit for dealing with it!

At Evil Martians, we advocate and build for startups on Rails, and we also know Ruby and Rails give teams a productivity boost and competitive edge. However, we’re also aware of what these startups struggle with the most: frontend. In this post, we share our “silver toolkit” for dealing with it!

Ruby on Rails 

Rails Versions 7.0.8.7, 7.1.5.1, 7.2.2.1, and 8.0.0.1 have been released!

Hi everyone!

Rails Versions 7.0.8.7, 7.1.5.1, 7.2.2.1, and 8.0.0.1 have been released!

These are security patches addressing one new issue where using the content_security_policy helper with untrusted user input could lead to a bypass of the browser Content Security Policy.

We think this usage will be rare, and the default configuration is not vulnerable, but advise upgrading.

Older versions of Rails are unsupported, and users are recommended to upgrade to at least the 7.0 series, which will be receiveing security updates until April. See our maintenance policy for details.

Here is a list of security issues that these releases address:

Passenger - Phusion Blog 

Lower latencies during deploys in new releases of Phusion Passenger

Lower latencies during deploys in new releases of Phusion Passenger

Applications hosted by Phusion Passenger now benefit from lower latencies and lower resource usage during deployments and restarts.

Over the last couple of releases, Phusion has worked with one of our wonderful customers to improve the way that Passenger routes incoming requests to your application. These changes come in two parts: in Passenger 6.0.23 the Rolling-Restart feature was updated; and in Passenger 6.0.24 the algorithm Passenger uses to route requests to app processes was updated.

Rolling-Restart Process-Replacement Order

In Passenger 6.0.23 the Rolling-Restart feature of Passenger Enterprise was modified to replace app processes in newest-to-oldest order, to better take advantage…

Fractaled Mind 

Select dropdown for polymorphic associations

When building a CRUD-oriented web application with Ruby on Rails, most things are pretty straightforward. Your tables, models, controllers, and views all naturally align, and you can lean on the Rails scaffolds. One gap, however, is dealing with polymorphic associations in your forms. Let’s explore how global IDs can provide us with a simple solution.


For this blog post, let’s consider building an app that has Posts that have polymorphic content, where a post’s content can be either an Article or a Video.

We can scaffold such a resource with the Rails CLI:

bin/rails generate scaffold Post title:string! content:belongs_to{polymorphic}

This command will create a migration file like…

Notes to self 

How does Kamal deploy to multiple hosts

How does Kamal deploy to multiple hosts at once? And how to configure it?

SSHKit

Kamal is built around SSHKit which provides Kamal with the SSH connections to issue remote commands. Through out the Kamal codebase we can notice the following SSHKit DSL which let’s Kamal schedule work on each hosts with their own thread:

on(KAMAL.hosts) do |host|
  # Execute commands on each host
end

Kamal also enhances the SSHKit capabilities further in some ways. The most notable are the changes to SSHKit::Runner::Parallel that lets Kamal wait on all threads and collect the failures:

class SSHKit::Runner::Parallel
  # SSHKit joins the threads in sequence and fails on the first error it encounters,…
Hanami 

State of Hanami, December 2024

Welcome to your first State of Hanami update! 🌸

There’s plenty going on around Hanami. With these updates, I want to make it easy for everyone in the community to keep up. We’ll share our recent achievements, as well as our plans for what’s coming next.

We’ll bring you these updates twice a year. This one is special, though, because we get to cover all of 2024!

Two major releases

2024 was a big year for Hanami. We made two major releases:

  • Hanami 2.1 in February, introducing our view layer and frontend assets support.
  • Hanami 2.2 in November, introducing our database layer as well as operations.

Two years after we brought you Hanami 2.0, our vision for…

Saeloun Blog 

Rails 8 Adds Parameters#expect To Safely Filter And Require Params.

Rails 8 introduces params#expect, a new method that enhances parameter handling by filtering parameters based on expected types. This reduces errors caused by tampering or invalid input.

Before

ActionController parameters allows us to choose which attributes should be permitted with the help of require and permit. By default, the recommended way of handling parameters in Rails works fine. Until someone using our app starts messing with the parameters and causing 500 errors.

params.require(:post).permit(:title, :summary, categories: [:name])
http://localhost:3000/?post[title]=Hello World

#=> {"title"=>"Hello World"}

Passing a String Instead of a Hash

If someone tampered params by…

Stefan’s Blog 

Gitlab + Hetzner S3: Migrate Omnibus Gitlab CE storages to new Hetzner S3

Recently, Hetzner announced the new S3-compatible storage service. At the same time, we are using Gitlab CE as our main development back-end since their early 1.0 versions - as issues back-end, customer inquiries management, container registry, CI-CD with runners, company chat via Mattermost, and of course as a git repository. During the last 5 years or so, we were running Gitlab as the Omnibus installation, meaning, all the upgrades of Gitlab were done by the package manager. If you are following the upgrade path, we had no issues ever during upgrades. One issue though, was the increasing space requirements, especially after slowly adopting Docker for deployment, like using Kamal in a…

Short Ruby Newsletter 

Short Ruby Newsletter - edition 117

The one where 1Password joins The Rails Foundation and where Dave Thomas solves Advent of Code with Ruby
The Bike Shed 

450: Javascript-Driven Development?

Joël and Stephanie go back to fundamentals as they pick apart some recent conversations they’ve been having around the office.

Together they discuss the advantages of GraphQL over a REST API, how they utilise JSONB over a regular column or table, and the use-cases for and against a frontend framework like React.

But what’s the theme that ties all these conversations together?


The article mentioned in this episode was Why I’m over GraphQL

Your hosts for this episode have been thoughtbot’s own Stephanie Minn and Joël Quenneville.

If you would like to support the show, head over to our GitHub page, or check out our website.

Got a question or comment about the show? Why not…

Ryan Bigg's Blog 

Scoping an Active Record join

Active Record is well known for its footguns, like N+1 queries and letting you dump all the business logic for your applications in models. (For an alternative, read Maintainable Rails.)

A lesser-known footgun is this seemingly innocuous use of joins in a tenanted Rails application. By “tenanted” I mean that most records have something like a tenant_id on them that declares ownership. In our case, it’s merchant_id. Here’s the query:

FraudCheck.where(merchant: merchant).joins(:purchase)

Fraud checks belong to a merchant, and they also belong to a purchase. Purchases have just the one fraud check. Merchants have many fraud checks and purchases.

The query this executes is:

SELECT…
Gusto Engineering - Medium 

Bee-ing in Sync: Centralizing User Data with a CDP

Two bees on a yellow flower

Co-authored by Julie Chen

Imagine a bustling beehive, but instead of a well-coordinated colony, every bee is flying in its own direction, collecting pollen and nectar from its own flower patch and dropping it into random cells within a hive. There’s no queen to guide the workers, no organization, and no way to ensure the honey is uniformly distributed. Chaos ensues and the hive struggles to produce consistent results.

At Gusto, managing user data across our different platforms often felt like this chaotic hive. Our Backend, Web, iOS, and Android systems each maintained direct integrations with tools empowered by our Marketing, Data/Analytics, Customer Service, and Sales teams. These…

The Rails Tech Debt Blog 

Refactoring Rails: Strategies to refactor models

There’s abundant online guidance about refactoring controllers and keeping them lightweight, but resources on model refactoring are less common. In this blog, we’ll explore some techniques for effectively refactoring models.

The refactoring goal remains consistent whether you’re working on a controller, model, or any other file. The current file might be complex, lengthy, or error-prone. Our objective is to create code that is:

  1. Easier to understand
  2. Simpler to maintain
  3. Less susceptible to bugs

Before beginning the refactoring process, two critical prerequisites must be addressed:

  1. How do you determine that a file needs refactoring?
  2. Do you have sufficient test coverage for…

How do you determine that a file needs…

Fractaled Mind 

Loading extensions

Rails continues to expand its lead as the single best platform for building web applications backed by SQLite! You can now load extensions directly from the database.yml file. This now means you have quick and easy access to the full range of SQLite extensions. This is a major step forward from the previous way, which required writing a custom initializer or using the enhanced adapter.


The PR that was recently merged for this feature was implemented by the one and only Mike Dalessio (aka @flavorjones).

It builds on the work that Mike did in the sqlite3-ruby driver to make loading extensions much easier.

These two features together allow your config/database.yml to look like:

develop…
Passenger - Phusion Blog 

Passenger 6.0.24

Passenger 6.0.24

Version 6.0.24 of the Passenger application server has been released. This release adds packages for Ubuntu 24.10 (Oracular), and improves rolling restart performance.

Passenger 6 introduced Generic Language Support, or: the ability to support any and all arbitrary apps.

Rolling restart improvements

We changed the way we route requests during a Rolling Restart in order to provide better performance and reliability. Instead of picking the least-busy process to route requests to, we now prioritize new processes first. During a rolling restart, this new behavior leads to more efficient utilization of application caches, faster validation of new rollouts, and faster recovery from problematic…

Fractaled Mind 

Introducing sqlite.directory

sqlite.directory is a directory of web applications that use the SQLite database engine in some meaningful capacity in production. I have just launched the initial release today. Check it out and list your SQLite-backed app today: https://sqlite.directory

A screenshot of the sqlite.directory listing form


The whole app is open source, a simple #SQLiteOnRails application. The codebase is vanilla Rails, Puma, and—of course—SQLite. Basically the simplest possible setup. Feel free to make suggestions or improvements.

https://github.com/fractaledmind/sqlite.directory

I’ve started simple and minimal, but there are all kinds of additional data we could gather about production applications that rely on SQLite. Let me know your thoughts on…

Rails Designer 

Simple accordion without JavaScript

It’s no secret that HTML and CSS has gotten a lot better over the years. And while I have become to enjoy writing JavaScript, whenever I can get away with it, I do.

One of those things that don’t need JavaScript is the typical accordion. It’s the kind of component that is simple to create with JS frameworks like Vue, Alpine and Stimulus, but for the most basic version you don’t need any of them. And to make them look good all you need is CSS.

This example is what I am going for. You see it doesn’t have to be the typical FAQ-list style. Using it for sections like this one, works perfectly fine too.

This article goes from:

  • the basics;
  • to adding visual interest;
  • to cool…
Josh Software 

Kya Aapke Software Mein AI Hai?

Remember the iconic toothpaste ad: “Kya aapke toothpaste mein namak hai?” It made everyone wonder why on earth we needed salt in toothpaste. Fast forward to today, and we’re living in a similar moment in tech: “Kya aapke software mein AI hai?” If the answer is no, prepare for judgmental stares, awkward silences, and unsolicited advice about … Continue reading Kya Aapke Software Mein AI Hai?
Hotwire Weekly 

Week 49 - Hotwire Essentials tutorial, Solid Cable in Production, and more!

Hotwire Weekly Logo

Welcome to Hotwire Weekly!

Welcome to another issue of Hotwire Weekly! Happy reading! 🚀✨


📚 Articles, Tutorials, and Videos

Hotwire Essentials is here: Learn Hotwire by building a podcast player - Lindsey Christensen and the thoughtbot team launched an interactive tutorial called "Hotwire Essentials". Hotwire Essentials takes you step-by-step through building a functional podcast player and teaches you how to apply Hotwire patterns to solve real-world problems. Learn Turbo's capabilities, Stimulus controllers, and best practices for server-driven interactivity. The source-code for the app is also available on GitHub.

Why Disconnect in Stimulus Controller - Rails Designer emphasizes the…

All about coding 

Everything that I published this week about Ruby #4

Monday

Every Monday, I publish the Short Ruby Newsletter:

Short Ruby Newsletter - edition 116 - The one where Rails World, Friendly.rb, and EuRuKo announced the dates for 2025 conferences, and Marco Roth announced rubytriathlon.com

Tuesday

I wrote and shared on social media a recommendation of two products for blogging made by two members of our Ruby community:

Two recommendations if you want to start a blog

Wednesday

I finished an article I started during the weekend when I installed the Writebook for booklet.goodenoughtesting.com where I shared how you can override a class method or instance method of a Ruby object used in a Ruby on Rails app:

Overriding Methods in Ruby on Rails: A…

Ruby Rogues 

Black-Belt Debugging with Chelsea Troy - RUBY 663

In this episode of Ruby Rogues, Chelsea Troy teaches us to hone our debugging skills to a razor-sharp edge. We learn how to actively improve debugging skills, train troubleshooting instincts and practical strategies for tackling brain-bending bugs.

Links

Picks


Become a…
The Code Gardener 

Hexagonal Architecture + Rails

Hexagonal Architecture + Rails

Last night, Fito and I watched Alistair Cockburn's Hexagonal Architecture talk from the Tech Excellence Conference. We really enjoyed it, and despite thinking I already understood the pattern, I learned a ton. In fact, before you continue reading, you should go watch it. Go ahead! I'll wait...

Awesome!

So, when I first started learning the Ports & Adapters pattern, I found it confusing. Eventually, I thought I'd made sense of it, but I was over complicating it. And, for some reason, it never clicked with me that the term "adapter" was a direct reference to the Gang of Four Adapter Pattern. So, seeing the pattern represented so simply in code was a real face-palm moment for me. And, it was the…

justin․searls․co - Digest 

🎙️ Breaking Change podcast v25 - Ghost Engineering

Direct link to podcast audio file

I left the country for a few weeks to get that taste out of my mouth but now I'm back and as salty as ever. Brace yourself.

I made a pretty strong appeal that you should e-mail the show at podcast@searls.co, so I won't repeat myself here. DO IT. DO IT NOW.

Hopefully I'll be back at least once more before we call it for 2024. Stay tuned. 📻

Remote Ruby 

Jason Meller on 1Password joining the Rails Foundation

In this episode, Chris catches up with guest Jason Meller, CEO and founder of Kolide. Today, Jason shares exciting news about Kolide, a startup focused on device security, which was recently acquired by 1Password. He delves into the history of Kolide, its growth, and its acquisition by 1Password. Jason also talks about the technical aspects of Kolide’s product, the importance of behavioral science in security, and the transition to working with 1Password. The conversation touches on scaling challenges, the hiring process, and Rails' influence on their development practices. Chris talks about his contribution by discussing improvements in the Getting Started Guide for Rails 8 and the…