---
title: "A proposal for overloaded methods"
publication: "Ruby Weekly"
issue: 662
published_at: "2023-07-13"
canonical_url: "https://rubyweekly.com/issues/662"
---

Plus a better way to work with SQLite, some counter culture, and decorating your Ruby functions. |        

#​662 — July 13, 2023 

[Read on the Web](https://rubyweekly.com/issues/662)  

Together with [![FastRuby.io\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,w_467,h_106/e_make_transparent/co_white,e_outline:14/y65nyff19ylf5udphsq4.png)](https://go.fastruby.io/3bl)   

Ruby Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/y1gbnzwhsatvenduil2n.jpg)](https://bugs.ruby-lang.org/issues/19764)  

[`defp`: Proposing a Way to Define Overloadable, Pattern Matched Methods](https://bugs.ruby-lang.org/issues/19764) — Few language proposals made on [Ruby’s issues board](https://bugs.ruby-lang.org/projects/ruby-master/issues) make it to fruition, but with pattern matching becoming increasingly more relevant in Ruby, this is an interesting idea and builds on [earlier thoughts by Victor Shepelev.](https://zverok.space/blog/2023-05-05-ruby-types.html) 

Zeke Gabrielse   

[Integrating Web Push with Rails](https://fly.io/ruby-dispatch/push-to-subscribe/) — The mechanism and protocols behind implementing push-based Web notifications are complicated, so it’s fantastic that Sam has put together a complete post showing the main steps and code involved to add push notifications to a modern Rails app. 

Sam Ruby   [![\](https://copm.s3.amazonaws.com/28f7c4da.png)](https://go.fastruby.io/3bl) 

[💸 Budget-Friendly Rails Maintenance Starting at $1k/Month 🚀](https://go.fastruby.io/3bl) — Don't want to lose 25% of your efficiency to tech debt? [FastRuby's](https://ruby.social/@FastRuby) remediation services gradually upgrade core dependencies and refactor costly files. The team behind the RailsConf Rails Upgrade Workshop can help you level up for a monthly flat-rate. 

Bonsai 🌳 by FastRuby.io sponsor   

[Steep 1.5: A Static Type Checker for Ruby](https://github.com/soutaro/steep/wiki/Release-Note-1.5) — Ruby 3.0’s introduction of the RBS type signature language teased a world of statically type-checked Ruby for those who wanted it, but another piece is required: a tool to *do* the type checking. Enter [Steep](https://github.com/soutaro/steep). 

Soutaro Matsumoto   

📅 [RubyConf](https://rubyconf.org/) is taking place this November in San Diego, CA and its [call for papers is now open.](https://sessionize.com/rubyconf-2023/) You've got till August 20 to propose either a talk or workshop. 

🤔 Justin Searls ponders [_"the looming demise of the 10x developer"_](https://blog.testdouble.com/posts/2023-07-12-the-looming-demise-of-the-10x-developer/) – an article that will give you some food for thought, even if you disagree. 

🍏 [Julia Evans shows off Lima,](https://jvns.ca/blog/2023/07/10/lima--a-nice-way-to-run-linux-vms-on-mac/) a particularly quick and easy way to spin up Linux VMs on macOS. (A VM is just two commands away if you use Homebrew or Nix..) 

🤖 I recently linked to [a gem that adds vector querying features to SQLite](https://github.com/asg017/sqlite-vss) and promised to share some code that uses it to store and compare LLM embeddings. [Here is that code.](https://gist.github.com/peterc/b9723e648cd2fc95c2689dedf9c6b6d2) I'll write an actual blog post in due course ;-) 

🚂 A proposal for Rails to support [optimistic locking without needing`lock_version`.](https://discuss.rubyonrails.org/t/proposal-optimistic-locking-without-lock-version/83221)   

📗 And a book: [Ruby on Rails Background Jobs with Sidekiq](https://pragprog.com/titles/dcsidekiq/ruby-on-rails-background-jobs-with-sidekiq/) — A short book, currently in beta, published by Pragmatic Bookshelf. The author notes: _“This book is based around the truth that putting code into Sidekiq jobs is almost trivial, but_ operating _such a system is not. It requires careful design, monitoring, and understanding of how the jobs actually run.”_ 

Dave Copeland  

📕 Tutorials, Articles, and Videos  

[Turbo, Stimulus, Hotwire.. What's the Difference?](https://www.ducktypelabs.com/turbo-vs-stimulus/) — Rails has gained a bunch of snappily named extra pieces over the past few years, and if it’s not been clear what some of them are, or if you need to explain it to someone else, this will help. 

Sid Krishnan   

[Implementing Rails-Like Controllers in a Non-Rails App](https://www.akshaykhot.com/implement-rails-controllers-in-ruby/) — The latest in Akshay’s series on [building a Ruby webapp from scratch](https://www.akshaykhot.com/building-web-application-without-rails/) (no Rails!) tackles the idea of _controllers_ and what they actually do under the hood. 

Akshay Khot   

[Free eBook: Advanced Database Programming with Rails and Postgres](https://pganalyze.com/ebooks/advanced-database-programming-rails-postgres?utm_source=RubyWeeklySecondary07132023) — Learn about subqueries, materialized views, and custom data types in Postgres & Rails and follow along with our examples. 

pganalyze sponsor   

[Tweaking Emacs for Ruby Development in 2023](https://johnhame.link/posts/tweaking-emacs-for-ruby-development-in-2023/) — Did you know Matz was a huge Emacs fan and Emacs influenced Ruby’s development and syntax? There’s [a slideshow](https://www.slideshare.net/yukihiro_matz/how-emacs-changed-my-life) ([transcript](https://news.ycombinator.com/item?id=6094798)) about that. 

John Hamelink   

[Performant Database Tree Traversal with Rails](https://planetscale.com/blog/performant-database-tree-traversal-with-rails) — The folks at PlanetScale (a serverless MySQL platform) needed to figure out 3 way merges for database schemas and had to work through a tree of objects in their database to find the common ancestor between two branches. 

Mike Coutermarsh   

[How to Use `enum` Attributes in Rails](https://www.honeybadger.io/blog/how-to-use-enum-attributes-in-ruby-on-rails/) — Enums provide a list of values to model attributes to drive consistency and make code more understandable. Not mentioned in this article is Rails 7’s [improved support](https://blog.saeloun.com/2023/06/21/rails-7-extends-enum-support/) for using Postgres's native enum support. 

Jeffrey Morhous (Honeybadger)   

[Fix Sneaky `ArgumentError`s When Upgrading from Ruby 2 to 3](https://www.fastruby.io/blog/fix-sneaky-argument-error-when-upgrading-ruby.html) 
Francois Buys   

[Polymorphic Relationships in ActiveRecord](https://dick.codes/2023/07/10/polymorphic-relationships.html) 
Dick Davis   

[An Introduction to Devise for Rails](https://blog.appsignal.com/2023/07/12/an-introduction-to-devise-for-ruby-on-rails.html) 
Aestimo Kirina  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/b8xjiuwne0at4tuiq4nj.jpg)](https://github.com/kjleitz/adornable)  

[Adornable: Decorators for Ruby Methods](https://github.com/kjleitz/adornable) — If you’ve ever looked at Python’s decorators or Lisp’s ‘[advice](https://en.wikipedia.org/wiki/Advice_%28programming%29)’ and thought you’d like a similar way to extend Ruby methods, this is for you. I like the idea, but can’t see it catching on unless it became an official feature. 

Keegan Leitz   

[Extralite 2: Another Way to Work with SQLite](https://github.com/digital-fabric/extralite) — An alternative (and faster) SQLite wrapper for Ruby that comes in two flavors: one that uses the system installed SQLite and one that bundles 3.42.0. [v2.0](https://github.com/orgs/digital-fabric/discussions/112) (quickly followed by v2.1) is a big update and includes enhanced querying possibilities and improves the Sequel adapter. 

Sharon Rosner   

[Is Your Career Safe From AI Disruption? Future-Proof Your Career With _Interview Kickstart_](https://learn.interviewkickstart.com/course/machine-learning-course?utm_source=cooperpress&utm_campaign=cooperpress_ruby_mlswitchup) — Join our free webinar to learn more. Don't get left behind. Transition to AI/ML roles with IK: FAANG+ AI/ML Coaches, a capstone project, and 15 mock interviews. 

Interview Kickstart sponsor   

[Shrine 3.5: The File Attachment Toolkit for Ruby Webapps](https://shrinerb.com/) — The first minor level [update](https://github.com/shrinerb/shrine/blob/master/CHANGELOG.md#350-2023-07-06) in 2 years for the powerful plugin-driven file attachment/uploads system. Validations, background jobs, cloud storage integrations, and more await. [GitHub repo.](https://github.com/shrinerb/shrine) 

Shrine   

[Counter Culture 3.4: Fast Counter Caches for Rails Apps](https://github.com/magnusvk/counter_culture) — Boasts numerous improvements over standard counter caches. Tested against all maintained lines of Ruby and Rails. 

Magnus von Koeller   

[PublicSuffix: Domain Name Parser Based on the Public Suffix List](https://github.com/weppos/publicsuffix-ruby) — The [Public Suffix List](https://publicsuffix.org/) lets you break domains into their unique and common parts - for example, `microsoft․com` is `microsoft` and `com`, but it gets more complicated when you throw country codes, nested TLDs, and popular services into the mix. 

Simone Carletti     

Jobs  

[Find Ruby Jobs with Hired](https://hired.com/join/?utm_source=newsletter&utm_medium=sponsor&utm_campaign=%28b2c%29%28l-all%29%28r-all%29%28cooper-rubyweekly%29&utm_content=easy-job-hunting) — Hired makes job hunting easy-instead of chasing recruiters, companies approach you with salary details up front. Create a free profile now. 
Hired      

- [ruby_parser 3.20.3](https://zenspider.com/releases/2023/07/ruby_parser-version-3-20-3-has-been-released.html)
 ↳ A Ruby parser written in pure Ruby.
- [ViewComponent 3.4](https://github.com/ViewComponent/view_component)
 ↳ Reusable, encapsulated view component system.
- [Goru 0.3](https://github.com/bryanp/goru)
 ↳ Experimental concurrency library.
- [Devise::OTP 0.6](https://github.com/wmlele/devise-otp)
 ↳ 2FA for Devise using TOTPs.
- [RSpec::RequestDescriber 0.4](https://github.com/r7kamura/rspec-request_describer)
 ↳ RSpec plugin to write self-documenting request-specs.
- [LangChain.rb 0.6.5](https://github.com/andreibondarev/langchainrb)
 ↳ Build LLM-backed apps in a composable way.
- [RubyGems 3.4.16](https://blog.rubygems.org/2023/07/10/3.4.16-released.html)         

Curated by [Peter Cooper](https://twitter.com/cooperx86) and [Glenn Goodrich](https://twitter.com/ruprict).
Published by [Cooperpress](https://cooperpress.com/). 

[Change your email](https://rubyweekly.com/edit_subscription/*|UID|*) or [Stop getting this newsletter.](https://rubyweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom [Supporting Ukraine](https://linktr.ee/RazomForUkraine) 

Other weekly newsletters we publish include [Postgres Weekly](https://postgresweekly.com/), [React Status](https://react.statuscode.com/), [Frontend Focus](https://frontendfoc.us/), and [JavaScript Weekly](https://javascriptweekly.com/).
