---
title: "Factory Bot 6.0, Enumerable#filter_map, and scraping the Web with Ruby"
publication: "Ruby Weekly"
issue: 507
published_at: "2020-06-25"
canonical_url: "https://rubyweekly.com/issues/507"
---

Plus more of this week's Ruby news, views, and libraries.       

#507 — June 25, 2020 

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

Ruby Weekly 

![](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/v1593012433/hznkp40t4drwqyqrktyw.png)  

[Building GitHub-Style 'Hovercards' with Stimulus and HTML-Over-The-Wire](https://boringrails.com/articles/hovercards-stimulus/) — HEY! What’s old is new again. The concepts behind pjax to update a page take center stage with some new tools (Stimulus 2.0) thanks to Basecamp’s new app (HEY). A great writeup. 

Matt Swanson   

[Factory Bot 6.0: A Library for Setting Up Ruby Objects as Test Data](https://github.com/thoughtbot/factory_bot) — Last week it was the classic [Shoulda](https://github.com/thoughtbot/shoulda) testing system hitting v4, now Factory Bot has hit [6.0](https://github.com/thoughtbot/factory_bot/releases/tag/v6.0.0) ([automatically defined enum traits](https://github.com/thoughtbot/factory_bot/pull/1380) is a neat new feature). There’s a new release of [factory_bot_rails](https://github.com/thoughtbot/factory_bot_rails) too. Great to see thoughtbot keeping these useful tools updated.`#thoughtfulbot` 

thoughtbot, inc.   [![\](https://copm.s3.amazonaws.com/0ed1a9eb.png)](https://dashboard.redisgreen.net/rubyweekly) 

[Try Redis 6.0 on RedisGreen](https://dashboard.redisgreen.net/rubyweekly) — SSL encryption, seamless scaling, large key tracking and more, available now from RedisGreen. 

RedisGreen sponsor    

[Rails 6.0.3.2 Released](https://weblog.rubyonrails.org/2020/6/17/Rails-6-0-3-2-has-been-released/) — It might be a 0.0.0.1 release, but it’s for security reasons, and you are recommended to upgrade. What was fixed? A vulnerability that can allow untrusted users to run _pending migrations_ in production. 

Aaron 'Tenderlove' Patterson   

[An Introduction to Web Scraping with Ruby](https://www.scrapingbee.com/blog/web-scraping-ruby/) — This post is split into two parts: the first runs through the basics of scraping (along with the gems used) and the second dives into a full scraping setup using[Kimurai](https://github.com/vifreefly/kimuraframework). 

Pierre de Wulf   

[The AWS SDK for Ruby v2 End of Life Dates Announced](https://aws.amazon.com/blogs/developer/deprecation-schedule-for-aws-sdk-for-ruby-v2/) — It’s time to move to version 3 (which was released almost three years ago, to be fair) if you haven’t yet. v2 enters maintenance-only mode in November of this year, and is completely unsupported from November 2021. 

Amazon Web Services    

**⚡️ Quick bits:** 

- It's not Ruby specific news, but for anyone who lived through the PPC to Intel transition, [Apple's plan to move from x86 to ARM](https://www.apple.com/newsroom/2020/06/apple-announces-mac-transition-to-apple-silicon/) could certainly throw up some Ruby development hurdles to consider.
- Somehow we missed the release of [Cucumber 4.0](https://github.com/cucumber/cucumber-ruby) earlier this month, but 4.0.1 has just dropped, so we'll announce that instead 😉  

💻 Jobs  

[Senior Software Engineer, Ruby (US, Remote)](https://www.fastly.com/about/jobs/apply?gh_jid=2194831) — You'll be joining a passionate team of full stack engineers building the APIs at the heart of our customers’ experience. 

Fastly   

[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-77583) — Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started. 

Vettery  

ℹ️ _Interested in running a job listing in Ruby Weekly? There's [more info here](https://booking.cooperpress.com/jobs)_. 

📘 Articles & Tutorials  

[Postgres Indexes for ActiveRecord Join Tables in Rails Apps](https://pawelurbanek.com/rails-postgres-join-indexes) — Don’t count on the built-in helpers (i.e. `create_join_table`) to create the correct indexes. If you do, there’s a non-zero chance that you have unused indexes in your database. 

Paweł Urbanek   

[A Look at Ruby 2.7's `Enumerable#filter_map`](https://blog.bigbinary.com/2020/05/08/ruby-2-7-adds-enumerable-filter-map.html) — If you missed this addition to Ruby 2.7, check it out as it can help tighten up situations where you might otherwise use `select` and `map` back to back (though ultimately `filter_map` is just like map but that only returns truthy values). 

Ashik Salman   

[Why & How to Host your Rails 6 App with AWS Elastic Beanstalk and RDS](https://www.honeybadger.io/blog/rails-6-aws-elastic-beanstalk?utm_source=rubyweekly&utm_medium=email&utm_campaign=ruby) — From the Honeybadger Developer Blog featuring tutorials and good advice by the coolest error monitoring solution around.😎 

Honeybadger sponsor   

[Considering Rails Multitenancy in 2020](https://realptsdengineer.com/ruby-on-rails-multitenancy-in-2020/) — The Apartment gem is no longer maintained (though [this fork](https://github.com/rails-on-services/apartment/) works with Rails 6) but there are other ways to move ahead with multitenancy if you need it. 

PTSD Engineer   

[Graceful Request Retries in Ruby Applications](https://medium.com/@kirill_shevch/graceful-request-retries-in-ruby-applications-7bbeac5ebd40) — Kirill throws in some tips about background jobs and exceptions, as well. 

Kirill Shevchenko   

[Build an App with Active Record + CockroachDB](https://www.cockroachlabs.com/blog/build-an-app-with-active-record-cockroachdb) — CockroachDB, a distributed SQL database, now has a fully-supported Active Record adapter. [Direct tutorial link](https://www.cockroachlabs.com/docs/v20.1/build-a-ruby-app-with-cockroachdb-activerecord.html). 

Cockroach Labs   

▶[Rails App Code Coverage with SimpleCov and RailsBytes](https://gorails.com/episodes/simplecov-code-coverage-and-railsbytes) — You can add code coverage to your app using [SimpleCov](https://github.com/colszowka/simplecov) – this 11 minute screencast shows how, as well as using RailsBytes to automate it. 

Go Rails   

[Github Actions for Security Checking Rails PRs](https://dev.to/mehagar/make-use-of-your-github-actions-minutes-for-security-checking-rails-prs-169g) 

Michael Hagar   

[Rails Architecture Tips From Route Helpers](https://everydayrails.com/2020/06/22/rails-routes-helpers-grammar.html) — When you have Rails apps with methods that fall out of the standard CRUD routing approach, Rails can cope but there are ways to improve the experience. 

Aaron Sumner  

🛠 Code and Tools  

[Comma: A CSV Generation Extension for Ruby Objects](https://github.com/comma-csv/comma) — Define an output format in a basic DSL then easily create CSV from arrays, Active Record objects, etc. [Example code here](https://github.com/comma-csv/comma/wiki). 

Crafter, Meier, Katagiri et al.   

[RubyMine 2020.2 EAP4: Improved Completion, Support for Git Installed in WSL2, and More](https://blog.jetbrains.com/ruby/2020/06/rubymine-2020-2-eap4/) — Not everyone wants an IDE and not everyone wants a _commercial_ IDE, but if you do, RubyMine is a pretty good one and the latest updates will be welcomed by both Ruby 2.7 and WSL2 users. 

JetBrains   

[We Help Customers Speed Up Postgres Queries By 1000x. Learn How](https://pganalyze.com/ebooks/optimizing-postgres-query-performance?utm_source=RubyWeeklySecondary06252020) 

pganalyze sponsor   

[EBNF: An EBNF Parser and Generic Parser Generator](https://github.com/dryruby/ebnf) — Supports LL(1) parsing as well as the packrat parser approach. 

D.R.Y. Ruby   

[rails-k8s-demo: Dockerized Rails + Sidekiq + ActionCable PostgreSQL/Redis/Puma App](https://github.com/lewagon/rails-k8s-demo) — _“An attempt at creating a standardized Docker/Kubernetes-Helm/GitHub Actions setup for use with Rails projects.”_ 

Le Wagon   

[Jekyll 4.1.1 Released](https://jekyllrb.com/news/2020/06/24/jekyll-4-1-1-released/) — Fixing some adverse outcomes in 4.1.0. 

Ashwin Maroli         

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
