Difference Between Ruby Blocks, Procs, and Lambdas

If you're new to Ruby or if you've been using Ruby for a while but want to understand procs and lambdas a bit deeper, this post is for you. We will look at the Proc object, four ways to create procs and lambdas, see how to invoke them, and look…

How &: Works in Ruby

Chances are you've seen and written code like users.map(&:first_name) in ruby or rails applications many times. If you're new to Ruby, you may have wondered about this strange syntax. Let's demysify &: and explain exactly how it works. First we start with blocks and how to…

What is Arel: Between ActiveRecord and SQL Queries

I recently learned that ActiveRecord uses Arel under the hood. What is Arel? When would it be useful in practice? let's find out! Motivation ActiveRecord is useful and its DSL allows us to write many queries with .find_by and .where. But it does have limitations in the types of…