---
title: "Get more fiber(s) into your Ruby diet"
publication: "Ruby Weekly"
issue: 593
published_at: "2022-03-03"
canonical_url: "https://rubyweekly.com/issues/593"
---

Plus an in-depth look at asynchronous querying in Active Record, and an update to our most recent tip. |        

#​593 — March 3, 2022 

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

Ruby Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,e_tint:100/k0m9cfvix4voikbtmcpp.jpg)](https://pawelurbanek.com/rails-load-async)   

[The In-Depth Guide to Active Record's `load_async` in Rails 7](https://pawelurbanek.com/rails-load-async) — Concurrency has been a hot topic in the Ruby and Rails space for a while now (especially now we have fibers, ractors, and more at our disposal) and Rails 7 has added another tool to run ActiveRecord queries in the background. But, before you start ‘asyncing all the things’, there are considerations and careful testing to think about. And it must be good, since the creator of `load_async` even said: _“I must concur that this article is excellent, it’s better explained than I could do myself”._ 

Paweł Urbanek   

[A Look at Ruby's Fiber Scheduler Functionality](https://brunosutic.com/blog/ruby-fiber-scheduler) — Added in Ruby 3.0, the Fiber Scheduler interface opens up a nice approach for working with asynchronous operations using standard Ruby methods (no frameworks needed), making parallel operations even simpler and gem dependency-free. 

Bruno Sutic   [![\](https://copm.s3.amazonaws.com/f9f6dae4.png)](https://pganalyze.com/ebooks/efficient-search-in-rails-with-postgres?utm_source=RubyWeeklyPraimary03032022) 

[Free eBook: Efficient Search in Rails with Postgres](https://pganalyze.com/ebooks/efficient-search-in-rails-with-postgres?utm_source=RubyWeeklyPraimary03032022) — In this eBook, Leigh Halliday explains how to speed up a search query from seconds to milliseconds — walking through using exact matches, similarity matches with trigrams, partial matches with ILIKE, and natural language matches. 

pganalyze sponsor   

**IN BRIEF:** 

- The page is in Japanese but the [results and awards from the most recent Fukuoka Ruby Awards](http://www.digitalfukuoka.jp/topics/187?locale=ja) (which Matz is involved with) came out recently. [PicoRuby](https://github.com/picoruby/picoruby) picked up the top award, with other projects like [HexaPDF](https://github.com/gettalong/hexapdf) and [Glimmer DSL for LibUI](https://andymaleh.blogspot.com/2022/02/glimmer-dsl-for-libui-wins-fukuoka-ruby.html) picking up awards too. Congratulations to all.
- If you use the [image_processing](https://github.com/janko/image_processing) gem and pass commands to it from user input, you'll want to update ASAP. input to it, you'll want to update ASAP [due to this vulnerability](https://rubysec.com/advisories/CVE-2022-24720/).   

[Import Maps Under the Hood in Rails 7](https://blog.appsignal.com/2022/03/02/import-maps-under-the-hood-in-rails-7.html) — [Import maps](https://www.digitalocean.com/community/tutorials/how-to-dynamically-import-javascript-with-import-maps) provide a way to import external code into a project without a build tool (no Node or Webpack needed!) and support for them is enabled, by default, in Rails 7. 

Paweł Dąbrowski (AppSignal)   

[Ruby Fibers 101](https://blog.saeloun.com/2022/03/01/ruby-fibers-101.html) — Fibers (introduced way back in Ruby 1.9) are now getting some much-deserved extra attention due to the Fiber::SchedulerInterface released in 3.0 – this post provides another look in addition to the post already linked above. 

Swaathi Kakarla     

Jobs  

[Senior Rails Engineer @ Nebulab (Remote)](https://nebulab.com/careers?gh_src=a6448332teu) — Join our distributed team and build high-volume eCommerce applications in a workplace made by developers for developers. 
Nebulab   

[Fully Remote Senior RoR Engineer at Ticketsolve](https://www.ticketsolve.com/careers/senior-backend-ruby-rails-engineer/) — We are a Saas ticket platform focusing on new feature development after a re-platforming. Exciting stuff is coming... 
Ticketsolve Ltd   

[Join the World’s Largest Remote Workforce](https://topt.al/dxc76r) — We offer the freedom of freelance with the security of full-time. Start working remotely with the world’s top clients today. 
Toptal    

📕 Articles & Tutorials  

[Adding Super Fast Frontend Search in Rails with Lunr](https://blog.cloud66.com/adding-super-fast-frontend-search-in-rails-with-lunr/) — Create a very responsive search experience by indexing the content being searched _in the browser_. A clever, if unconventional approach, but it works for specific use cases. 

Khash Sajadi (Cloud66)   

[RubyConf 2021: The Talks You Might Have Missed](https://shopify.engineering/rubyconf-2021-the-talks-you-might-have-missed) — RubyConf 2021 took place in Denver late last year and while we’ve linked to a few talks, Shopify has put together a list of summaries and links to interesting talks given by their engineers. 

Jennie Lundrigan   

▶[Hotwire Modals, with Zero JavaScript](https://www.youtube.com/watch?v=WK16FeBfbxI) — If you don’t like writing any more JavaScript than you have to, Hotwire is refreshing, for sure. _(6 minutes.)_ 

Pete Hawkins   

[Project Management for Software Teams Has Never Been Easier](https://shortcut.com/?utm_source=cooperRubyWeekly&utm_medium=spon_nl&utm_campaign=prospecting&utm_content=easy) — Shortcut is fast and intuitive project management built for developers. Delight the scrum gods and try it now. 

Shortcut (formerly Clubhouse.io) sponsor   

[Zero-Downtime Migration of a Primary Key From `int` to `bigint`](https://engineering.silverfin.com/pg-zero-downtime-bigint-migration/) — Once you have billions of rows, `int` starts looking rather limited. While switching to `bigint` is a tedious task, it’s effective and can avert future problems. 

Radan Skoric (Silverfin Engineering)   

[Don't Waste Your Time on Asset Compilation on Heroku?](https://blog.arkency.com/dont-waste-your-time-on-assets-compilation-on-heroku/) — Precompiling and uploading assets to a CDN at the CI stage. 

Szymon Fiedler   

▶[Understanding `Proc` Objects](https://www.youtube.com/watch?v=1SZxieW4Tqw) — An 8-minute video that covers the basics. 

Jason Swett   

▶[A Chat with Andrew Culver, Creator of Bullet Train](https://www.codewithjason.com/podcast/10162982-135-andrew-culver-creator-of-bullet-train/) — [Bullet Train](https://bullettrain.co/) is a (paid) boilerplate app for building SaaS apps quickly on Rails. _(49 minutes.)_ 

Code with Jason Podcast podcast  

🛠 Code & Tools  

[Thredded 1.0: A Forum Engine for Rails Apps](https://thredded.org/) — We first linked to this project 6 years ago but it has now finally hit 1.0 and added Rails 7 and Ruby 3 support. It’s a message board system that works as an engine so you can run it standalone or as part of an existing Rails app, if needed. [GitHub repo](https://github.com/thredded/thredded). 

Mazovetskiy, Oliveira, et al.   

[WahWah 1.3: A Library for Reading Audio Metadata](https://github.com/aidewoode/wahwah) — For reading things like MP3 IDv3 tags, embedded images, and similar metadata in formats including MP3, M4A, OGG, OGA, OPUS, WAV, FLAC, etc. Pure Ruby too, with no dependencies. 

Aidewoode   

[Build Video for Ruby That Just Works](https://get.mux.com/3mwSSfL) 

Mux sponsor   

[Liquid 5.2: Safe, Customer-Facing Template Language for Webapps](https://github.com/Shopify/liquid) — Created at Shopify in 2006 (and still heavily maintained by them) Liquid is a popular way to bring flexible, safe templating and customization to end users. 

Shopify   

[Yake 0.5: A DSL for Writing AWS Lambda Handlers in Ruby](https://github.com/amancevice/yake) — The selling point is it uses a Rake-like declarative syntax. 

Alexander Mancevice   

[Glimmer Wordle 1.1.0: Wordle in Ruby with a JRuby and SWT Powered UI](https://andymaleh.blogspot.com/2022/02/glimmer-wordle-110.html) 
Andy Maleh   

[Jekyll 4.2.2 Released](https://jekyllrb.com/news/2022/03/03/jekyll-4-2-2-released/) 
Ashwin Maroli      

💡**Tip of the Week** 

   

### Avoiding (potential) malicious activity with `binstubs` 

In [the most recent tip](https://rubyweekly.com/issues/591), we learned more about binstubs, and specifically, adding to our `$PATH` variable so that we don't need to run `bin/<some_executable>` from a repo and can instead run `<some_executable>` from a repo. 

A few folks wrote to us in response to this tip, and correctly said that it only works if you are always in _trusted_ repositories. 

Why? A malicious repository could put an executable in the `bin` directory that overwrites a command we use commonly. For instance, an executable at `bin/ls`. If we've now set our `$PATH` variable such that we no longer need to specify `bin`, then simply running `ls` may execute whatever malicious code could be in `bin/ls`. 

Why _might_ we have malicious code locally though? Sometimes we clone repos to debug them, sometimes we `cd` into directories of gems that we don't know everything about, or anything else. 

We can still solve for this though! As a reader referenced, [this article](https://thoughtbot.com/blog/git-safe) gives us a clever solution. We can keep all of our trusted repositories in one directory. Then, in that directory, we can make a `.git/safe` directory (`mkdir .git/safe`). Then, if we add `.git/safe/../../bin` to our `$PATH`, we will only be able to execute any executables in the `bin` directories in repositories we trust! 

Thanks again for feedback on my last tip!    

This week’s tip was written by [Jemma Issroff](https://twitter.com/jemmaissroff).          

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

[Change your email address](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
