Finding profilers that reliably work proves to be a bigger challenge than most devs think. Here's a summary of the Rails profiler ecosystem: what works, what doesn't, and each profiler's niche. Read more
Learn how to use counter cache in your rails app, parent-child associations, counter cache best practice. Read more
If you are using Ruby on Rails, caching might be one of the best tools on your belt to build a better application. The idea behind caching in Rails is to serve thousands of concurrent users on a single server with a single database attached. Let’s take a look at some of the benefits caching can provide. Read more
With the official release of Rails 6 just around the corner, we round up all the major new features coming your way. It is an exciting release due to some big features coming upstream from the Basecamp and GitHub projects. Amongst the many minor updates, useful tweaks and bug fixes, Rails 6 will ship with two completely new frameworks: ActionText and ActionMailbox, and two big scalable-by-default features: parallel testing and multiple database support. So set your Gemfile to get Rails 6.0.0.rc1 and let’s get started! Read more
Like a pair of jumper cables, ActiveRecord's joins , includes , preload , and eager_load methods are incredibly useful, but also very dangerous when used incorrectly. Knowing when and where to use each approach - and even when to combine them - can save you considerable trouble. Read more
If you’re a Rails developer, then you’ve probably used Rails Logger on at least one occasion or another. Or maybe you have used it without even realizing, like when you run ‘rails server’ and it prints information to the terminal window, for example. Rails Logger provides us with a powerful way of debugging our applications and gives us an insight into understanding errors when they occur. But are you using all of the Rails Logger features? There’s a good chance you are not! So let’s take a more in-depth look at the logging system in Rails, look at some of its more unknown features, and establish some best practices for our log creation in the future. Read more
How can we take our existing Ruby on Rails applications and run them inside a Docker Container? In a recent post, we talked about Docker containers, and what you should know about them. Hopefully we cleared up any confusion you might have had about the Docker ecosystem. Perhaps with all that talk, it got you thinking about trying it out on one of your own applications? Well in this post we’d like to show you how easy it is to take your existing Ruby on Rails applications and run them inside a container. So, let’s assume you have an existing Rails project with a PostgreSQL database, and let’s walk you through the steps it would take to run this in a container instead. It’s a lot easier than you probably think! Read more
When I do a code review, one of the scariest things I see is logic like this: if Rails.env.production? do_additional_work end Why? Your beautiful tests and tightly integrated CI system won't execute that code. You won't see that code execute as you refresh your browser in development. From syntax errors ... Read more
Once your Rails app begins seeing consistent traffic, slow SQL queries will likely rear their ugly head, but how can you easily tell where your app is slowing down? Read more
DevTrace is a performance widget for your Rails applications in development. It sits unobtrusively in the corner of your page, just waiting to drop insight on your application: See stack traces, SQL timings, and more with just a click! This kind of insight is powerful. You can see how your ... Read more