Using Concurrent Ruby in a Ruby on Rails Application

Concurrent Ruby is a concurrency toolkit that builds on a lot of interesting ideas from many functional languages and classic concurrency patterns. When it comes to writing threaded code in Rails applications, look no further since concurrent ruby is already included in Rails via Active Support. Read more about this…

CTEs And Window Functions

I am a big fan of code readability, but being a fan and expecting the code I write to be readable are two different things. Readable code is easier to understand and much more straightforward to grasp. One significant difference I find while comparing readable and unreadable code, apart from…

Rails 5 silences assets logs in dev mode by default

As a Rails developer, it was a familiar picture of assets logs flooding the whole terminal in development mode. Fortunately, we could include quiet_assets gem in our application. It turns off the Rails asset pipeline log in development mode. Read more about this at: Rails 5 silences assets logs…

Rails 5 Expression Indexes & Operator Classes support

Let’s assume that in our health care application we have a page which shows all Patients. This page also has a filter and it allows us to filter patients by their name. We could implement the filter as shown here. Patient.where("lower(first_name) = ?", first_name.downcase)Read…

Attach arbitrary metadata to an Active Job in Rails 5

Rails 4.2 came with built-in support for executing jobs in the background using Active Job. Along with many enhancements to Active Job, Rails 5 provides the ability to attach arbitrary metadata to any job. Read more about this at: Attach arbitrary metadata to an Active Job in Rails 5…