All Articles

The AAA Pattern: Writing Robust Tests

Are you looking for a reliable way to test your applications? Look no further than the AAA pattern.

The AAA pattern stands for:

  1. Arrange
  2. Act
  3. Assert

This pattern helps you structure your tests in a clear consistent manner, and it is not tied to a particular programming language or testing tool, making it a versatile and effective approach to testing opens a new window .

Read more of The AAA Pattern: Writing Robust Tests opens a new window

The Dangerous Query Method Deprecation

Have you ever tried to update a Rails app from 5.2 to 6.0 opens a new window , or from 6.0 to 6.1 opens a new window ? If so, you might have seen this deprecation:

DEPRECATION WARNING: Dangerous query method (method whose arguments are used as raw SQL) called with non-attribute argument(s): "random()". Non-attribute arguments will be disallowed in Rails 6.0. This method should not be called with user-provided values, such as request parameters or model attributes. Known-safe values can be passed by wrapping them in Arel.sql(). (called from ...)

Note: While this deprecation message mentions Rails 6.0 as the version where the behavior is disallowed, that change was postponed, so the deprecation also shows in Rails 6.0. The behavior is actually disallowed in Rails 6.1.

What does this deprecation mean exactly? In this article, I will explain that in plain English, what issue it is trying to prevent, and how to fix the problem if you come across it in your codebase.

Read more of The Dangerous Query Method Deprecation opens a new window

Testing AJAX Controller Requests in Rails

Recently I got to work on a task that included understanding how to test JavaScript requests with RSpec opens a new window . One thing that I found missing during my time researching solutions was organized and detailed documentation explaining the solutions based on the version of Rails opens a new window and RSpec the application runs on.

Read more of Testing AJAX Controller Requests in Rails opens a new window

7 Common Mistakes in Rails Upgrades

Ruby on Rails opens a new window is a popular web application framework that is constantly evolving with new versions being released frequently. While upgrading to a newer Rails version can bring new features, better performance, and security patches/improvements, it can also be a challenging task.

In this blog post, we will discuss 7 common mistakes made while doing Rails upgrades opens a new window and how to avoid them.

Read more of 7 Common Mistakes in Rails Upgrades opens a new window

Two Approaches to Upgrading an Application

Since 2017 we have been focusing on upgrading Ruby on Rails applications opens a new window . It’s been quite a fulfilling learning process as we continuously improve our workflow best practices, and internal tooling.

In this article I will go into detail to explain how we determine the best approach to create the roadmap for a successful upgrade project.

Read more of Two Approaches to Upgrading an Application opens a new window

Heroku-22-Stack-Upgrade-Guide

As of May 1st, 2023, Heroku will no longer be supporting the Heroku-18 stack. The reason for this deprecation is to maintain synchronization with the Ubuntu Long Term Support releases. If you are currently running your Rails application on this stack, when you navigate to the Heroku dashboard you will notice a warning to upgrade to either Heroku-20 or Heroku-22 before the end of the Heroku-18 stack life on April 30th, 2023.

Heroku warning: the Heroku-18 stack is deprecated

While Heroku-18 will not be supported, do not be alarmed or concerned that the apps running on this stack will stop working. Heroku has confirmed that all existing applications will not be interrupted and non-build functionality will still be available. However, to maintain access to security updates, technical support and the ability to perform new builds, an upgrade will be necessary and is highly recommended.

Read more of Heroku-22-Stack-Upgrade-Guide opens a new window