---
title: "Three ActiveRecord mistakes that slow down Rails apps"
publication: "Ruby Weekly"
issue: 433
published_at: "2019-01-17"
canonical_url: "https://rubyweekly.com/issues/433"
---

This week's Ruby news, issue 433       

#433 — January 17, 2019 

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

Ruby Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/sggtzfnvtb2uqrxwyp20.jpg)](https://www.speedshop.co/2019/01/10/three-activerecord-mistakes.html)  

[3 ActiveRecord Mistakes That Slow Down Rails Apps](https://www.speedshop.co/2019/01/10/three-activerecord-mistakes.html) — The culprits are `count`, `where`, and `present?`, and here’s advice that you will, no doubt, use from someone who literally wrote a book on Rails performance. 

Nate Berkopec   

[Using Ruby in 2019](https://jasoncharnes.com/using-ruby-in-2019/) — If you need a few reasons to be excited about being a Rubyist this year (or fight off the yearly “Ruby is Dead” posts) then this is for you. 

Jason Charnes   [![\](https://copm.s3.amazonaws.com/003957a1.png)](https://pganalyze.com/ebooks/optimizing-postgres-query-performance?utm_source=RubyWeeklyPrimary) 

[eBook: Best Practices for Optimizing Postgres Query Performance](https://pganalyze.com/ebooks/optimizing-postgres-query-performance?utm_source=RubyWeeklyPrimary) — Learn how to get a 3x performance improvement on your Postgres database and 500x reduced data loaded from disk in this free pganalyze eBook. 

pganalyze sponsor   

[A New Form of Lambda Composition in Ruby 2.6](https://drivy.engineering/ruby-lambda-composition/) — 2.6 brings a couple of new proc composition operators: `<<` and `>>`, which allow easy, intuitive, and (dare I say) functional composition of procs. 

David Bourguignon   

[RubyFlow: A Ruby Community Link Blog](http://www.rubyflow.com/) — _RubyFlow_ is a community blog we run (all you need is a GitHub account to post) and has become one of our main sources of links, so if you have a library, tutorial, or something else Ruby related, post about it there. 

RubyFlow   

[Cuprite: A Headless Chrome Driver for Capybara](https://github.com/machinio/cuprite) — A _pure_ Ruby (no Java, Selenium, or WebDriver stuff needed here) driver that lets you run [Capybara](https://github.com/teamcapybara/capybara)-based tests on a headless Chrome browser. 

Machinio  

💻 Jobs  

[Senior Web Developer at Dr. Bill (Remote OK)](https://www.dr-bill.ca/senior-web-developer) — Dr. Bill helps Canadian doctors save time by streamlining their billing. Help lead our team into the next phase of growth. 

Dr. Bill   

[Senior Backend Engineer - Ruby on Rails (Berlin - On site)](https://daliaresearch.com/career-opportunities/1299217/?gh_jid=1299217) — Growing market and opinion research company, with a modern JavaScript and Ruby on Rails stack. We also have a team boat. Join us. 

Dalia Research   

[Find A Job Through Vettery](https://www.vettery.com/tech?utm_source=newsletter&utm_medium=cooper-rubyweekly&utm_term=tech&utm_content=grouped&utm_campaign=ad-77582) — Vettery specializes in developer roles and is completely free for job seekers. 

Vettery  

📘 Articles & Tutorials  

[How to Reduce Test Interference in Minitest](https://www.gregnavis.com/articles/how-to-reduce-test-interference-in-minitest.html) — If you’ve ever had issues with Rails test leaking state between test cases, here’s a gem that’ll run one test per process. 

Greg Navis   

[Partial Application in Ruby](https://www.morozov.is/2019/01/11/partial-application-in-ruby.html) — Partial application, or currying, is a technique that uses a function to create new functions of lower arity (meaning, they take fewer arguments.) 

Igor Morozov   

[Extracting Text From Images Using Ruby](https://aonemd.github.io/blog/extracting-text-from-images-using-ruby) — Using Tesseract, MiniMagick, & OpenCV to extract subtitle text from screenshots (to categorize memes, no less!) 

Ahmed Saleh   

[Performance Monitoring and Error Tracking for Rails](https://baseline.red) — With deep process inspection - diagnose runaway memory leaks and deadlocked/zombie/high CPU processes. 

Baseline Red sponsor   

[Serverless Slack Commands with Ruby: AWS Rekognition](https://blog.boltops.com/2019/01/14/serverless-slack-commands-with-ruby) — Using the Jets framework on AWS Lambda to create a Slack command that scrapes and filters images. 

Tung Nguyen   

[Crafting User Notifications in Rails with Active Delivery](https://dev.to/evilmartians/crafting-user-notifications-in-rails-with-active-delivery-5cn6) — Someone has created [a framework](https://github.com/palkan/active_delivery) to handle notification delivery that can use email, SMS, or just about any notification type you can dream up. 

Vladimir Dementyev   

[Building a Serverless API with the Jets Ruby Serverless Framework](https://blog.boltops.com/2019/01/13/build-an-api-service-with-jets-ruby-serverless-framework) — We first mentioned the Jets framework back in [issue 431](https://rubyweekly.com/issues/431), but here’s a proper tutorial showcasing its usefulness. 

BoltOps   

[Rails 6 Adds ActiveRecord::Relation#pick](https://blog.bigbinary.com/2019/01/16/rails-6-adds-activerecord-relation-pick.html) — A shortcut to select the first value for one or many attributes from a set of records. 

Prathamesh Sonpatki   

[Understanding the Eigenclass in Less Than 5 Minutes](https://medium.com/rubycademy/understanding-the-eigenclass-in-less-than-5-minutes-dcb8ca223eb4) — A bold claim for a somewhat obtuse concept? 

Mehdi Farsi  

🔧 Code & Tools  

[Suggest: Tells You Which Method Does The Thing You Want to Do](https://github.com/jbodah/suggest_rb) — `[1,2,3].what_returns? 1 # => [:first, :min]` 

Josh Bodah   

[TTY::Pie: Draw Pie Charts in Your Terminal Window](https://github.com/piotrmurach/tty-pie) — The latest release adds a way to format legend labels however you like. 

Piotr Murach   

[Shop Like a Developer – Discover and Experiment with Hot New Cloud Services 🔥](https://www.manifold.co/features?utm_campaign=RubyWeekly+&utm_source=newsletter&utm_medium=sponsorship) 

Manifold sponsor   

[FastJsonapi: A Super-Fast JSON:API Serializer for Ruby Objects](https://github.com/Netflix/fast_jsonapi) 

Netflix   

[Trav3: API Client for Travis CI API Version 3](https://github.com/danielpclark/trav3) 

Daniel P. Clark         

Curated by [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
