All Articles

Response#content_type: Rails 5.2 to 6.1

If you have ever upgraded Rails from 5.2 to 6.0 opens a new window , you might have run into issues with changes that had been made to the value of ActionDispatch::Response#content_type between the two versions.

If you have been lucky, you might not have even noticed there was a problem until Rails 6.0, after coming across this deprecation message:

Rails 6.1 will return Content-Type header without modification. If you want just the MIME type, please use `#media_type` instead.

What happened with ActionDispatch::Response#content_type between Rails 5.2 to 6.1? In this article, we will go into some background to learn what this method does, look at the differences in ActionDispatch::Response#content_type’s return value between the several Rails versions, and how you can fix the problem if you come across it in your codebase.

Read more of Response#content_type: Rails 5.2 to 6.1 opens a new window

Why You Shouldn't Run `rails app:update`

At FastRuby.io, we don’t always run rails app:update opens a new window in our process to upgrade Rails apps.

It might seem like a sacrilege - after all, that’s why the task was created, to make upgrading Rails as painless as possible, right? But we have found while upgrading dozens of applications that running rails app:update isn’t the best idea in all situations.

In this article, you will learn what rails app:update does, when it should not be used, and how to upgrade your Rails app without it.

Note: In Rails versions before 5.0, rails app:update was called rake rails:update.

Read more of Why You Shouldn't Run `rails app:update` opens a new window

10 Strategies for Upgrading Low-Coverage Apps

Are you considering an upgrade for your Rails or Ruby application, but you’re concerned about low test coverage? Don’t worry! In this post, we’ll explore effective strategies to address the risks associated with low test coverage. By implementing these strategies, you’ll be able to upgrade your application with confidence. Let’s dive in!

Read more of 10 Strategies for Upgrading Low-Coverage Apps opens a new window

How to Run Multiple Rails Versions on Heroku

Imagine having the ability to deploy the next version of Rails in a dual booted application on your Heroku staging server or review app before deploying it to production. This capability can help you avoid bugs and downtime in your live environment. In this blog post, we will guide you on how to deploy a Rails upgrade to a staging environment, allowing you to thoroughly test it before it goes live.

Read more of How to Run Multiple Rails Versions on Heroku opens a new window

Navigating Asset Management Madness in Rails

There have been a lot of changes over the years in asset management opens a new window for Ruby on Rails applications. The main question, after all the madness, is… “What should I do if I need to upgrade my Rails application?”

In this article we will talk about the options we have for each version jump.

Read more of Navigating Asset Management Madness in Rails opens a new window

Safeguarding Against Deprecation Regressions

You are upgrading a Rails application. You finished fixing a deprecation warning and it’s not present anymore. You continue working on other tasks and one day you find out the deprecation is back in the codebase. New code was added using the deprecated behavior, but it was not detected and now it needs to be fixed again…

How can you prevent that from happening and, at the same time, let the team know?

Read more of Safeguarding Against Deprecation Regressions opens a new window

Fix Sneaky ArgumentErrors When Upgrading Ruby

Upgrading from Ruby 2 to Ruby 3 can be a challenging task, especially when your Rails application relies on ActiveJob with Sidekiq. In the process, you may encounter cryptic ArgumentError exceptions that make the upgrade seem daunting. By following along you’ll be well-equipped to avoid some of the hurdles that come your way.

Read more of Fix Sneaky ArgumentErrors When Upgrading Ruby opens a new window

The History of the Asset Pipeline

Over the years, Rails has been changing the default way to handle assets while also adding different alternative options at the same time.

At first there were static files, then Sprockets appeared, then we had a choice between Webpacker and Sprockets for a few years, now Webpacker is gone and importmaps are the default. But jsbundling-rails and cssbundling-rails are also official options.

Sound confusing? In this article we’ll try to explain the history of all these changes.

Read more of The History of the Asset Pipeline opens a new window

Fortify Rails: Defending Against Bad Actors

On Monday June 12th, 2023, FastRuby.io partnered with Expedited Security opens a new window to talk about how to secure your Ruby on Rails application.

In this free webinar Ernesto Tagwerker opens a new window (FastRuby.io) and Mike Buckbee opens a new window (Expedited Security) discussed topics of interest related to Rails security opens a new window (exploitable ActiveRecord code, vulnerable dependencies, botnets, DDoS, a breakdown of common threats, and more).

You’ll also get a sneak peak of Wafris opens a new window , an Open Source service to prevent attackers and dark traffic to your application and of our new Rails Security Audit opens a new window , a service to detect vulnerabilities and exploitable code in your app!

Read more of Fortify Rails: Defending Against Bad Actors opens a new window

Readonly Associations and Upgrading to Rails 4

After upgrading your application from Rails 3 to Rails 4, you might start seeing the following deprecation warning if you are using the readonly option in an association.

DEPRECATION WARNING: The following options in your Company.has_many :users declaration are deprecated: :readonly. Please use a scope block instead. ...

In this blog post, we’ll discuss in detail what the readonly option is and how to handle the deprecation warning.

Read more of Readonly Associations and Upgrading to Rails 4 opens a new window