“Wildebeests on charred grass.” Photo by Susan Jane Golding. Used under a Creative Commons CC BY 2.0 License. https://flickr.com/photos/sjgolding/29694808950

Collapsing old Rails Migrations

By Daniel Morrison

I don’t like deleting old migrations in my Rails apps, but if I did, here’s how I’d do it,

Team Tools Roundup

By Dana Jones

Our distributed team uses some really interesting tools to do the work we do. Check out our tool roundup to find some new tools to try yourself.

Testing an Uploaded File in Rspec

By Victoria Gonda

Sometime you need to test how your code handles an uploaded file, but you don’t want to upload it in your test. Luckily, there’s an easy way to handle this.

Getting Started with Action Cable

By Victoria Gonda

With the inclusion of Action Cable in Rails 5, we can easily add WebSockets to our Rails applications. This post walks through how to set up Action Cable as a response to an action on an Active Record model.

Avoid parsing Rails controller params by using Metal

By Daniel Morrison

While looking at a controller today, I came to the conclusion it’s better to use ActionController:API instead of ActionController::Metal. Here’s why.

My Ruby Epiphany

By Daniel Morrison

I’ve been using and teaching Ruby for many years now, but I recently had an epiphany about private methods.

Solutions to Potential Upgrade Problems in Rails 5

By Jason Roelofs

The Rails 5 upgrade has a few changes that may cause confusion. We look at how to get around the disabling of autoloading and look at the new deprecation warnings.

Interview: Talking Middleman V4 and Front-end Dev with Thomas Reynolds

By Jon Stokes

Middleman was built by Thomas Reynolds over eight years ago as a way to build static sites with easy-to-use framework. I talk with Mr. Reynolds about a few new features for Version 4 of the tool.

Keep Your Certificates Current Using Your Test Suite

By Daniel Morrison

How can our test suite tell us when a certificate expires? We’ll show you.

Bi-Directional and Self-Referential Associations in Rails

By Joshua Kovach

I’ve been working on an application that works to match users together based on a complex set of criteria (read: big slow database query and in-memory processing). The core usage of the application revolves around these user matches, so I want to make sure that either the algorithm will run very fast or can be cached so that it’s not run every time a user visits their matches page.

The most important requirement for our matches is reciprocation. To solve this problem and meet all of the requirements, we can create a bi-directional, self-referential, self-syncing, many-to-many association between users using a has_many :through association with a join model to keep track of a user’s matches.

Quick Setup for Your Rails Apps

By Daniel Morrison

We need to make getting up and running with our Rails apps easier. Here’s my attempt.

Fixing Intermittent Failing Tests

By Daniel Morrison

Some tricks to help you fix tests that sometimes fail.

Better Ruby Rounding

By Brian Hempel

Need to round to the nearest 30 minutes or up to the next 250 or some other fun rounding case? Ruby’s build-in round, floor, and ceil won’t help you, but the Rounding gem will.

Bootstrap Your App

By Jason Roelofs

Insert your app’s bootstrapping into CI to ensure that setting up a new developer is one script invocation.

Streaming Data From Postgresland to Rubyland

By Brian Hempel

I recently gave a talk covering find\_each, pluck, and the PostgreSQL Cursor gem for the West Michigan Ruby Users Group.

Optimizing Rails for Memory Usage Part 4: Lazy JSON Generation and Final Thoughts

By Brian Hempel

Code to copy-paste so you can lazily serialize JSON and maybe even stream it to the client, and an argument for why we shouldn’t have to do any of this.

Optimizing Rails for Memory Usage Part 3: Pluck and Database Laziness

By Brian Hempel

Some ways to reduce memory usage as you gather records out of your database into Rubyland.

Optimizing Rails for Memory Usage Part 1: Before You Optimize

By Brian Hempel

Part one of a four-part series which will show you how to optimize a memory-heavy Rails API action.

Optimizing Rails for Memory Usage Part 2: Tuning the GC

By Brian Hempel

Changing Ruby’s garbage collection parameters is the least invasive way to optimize your app’s memory usage.

Quickly Test Slow Uploads

By Daniel Morrison

How do you test a slow file upload? Force it to be slow.

Let's Simplify Ruby

By Daniel Morrison

I want to make Ruby better by making it smaller. Who wants to help?

How we write a Gemfile

By Daniel Morrison

Tips on how we like to organize Gemfiles and keep it clean.

Why Isn't Ruby Rescuing My Exception?

By Brian Hempel

By default, Ruby only rescues subclasses of StandardError to allow the really bad stuff to halt your program.

Segmentation faults on Travis CI caused by libxml-ruby

By David Genord II

If ruby is segmentation faulting on Travis CI, try updating libxml

Public Methods != Public API

By Steve Richert

I love designing and building APIs. Usually those APIs are in the form of REST web services. A lot of care goes into the interface of a web service because it’s how your application is presented to the outside world. But what about the interfaces of your internal code?

Mocking HTML5 API's Using PhantomJS Extensions

By Ryan Glover

Recently one of our projects called for using the browser’s Geolocation API. We were excited about this project. However, we had an immediate concern about how to test a feature that interacts with one of the browser’s built in APIs.

Ruby 2 SSL Verification Failed?

By Jason Roelofs

Many users are having OpenSSL validation issues with Ruby 2.0 across various platforms. Turns out there are multiple issues at hand, each requiring different fixes.

Tests Still Slow? Might be bcrypt!

By Jason Roelofs

How Google’s perftools led me to add a single line of code that cut test suite run times in half.

Fun with Unicode Math in Ruby √

By Daniel Morrison

We had way too much fun with Ruby and Unicode, and the result is that you can now join in the fun with our unicode_math gem.

5 Awesome Things About RubyMotion

By Tim Bugai

Last week HipByte released RubyMotion and although I was originally skeptical, I’ve grown to really like it.

Walken on Rails

By Daniel Morrison

Our new screencast series features narration by Christopher Walken.

Give pry a Try

By Daniel Morrison

One of the things holding us back from developing on Ruby 1.9.3 has been ruby-debug. So after many people suggested we try it, we gave pry a shot. I don’t know why we didn’t before; it is quick, easy, and allows a wide range of Ruby versions.

Install Ruby 1.9.3 with libyaml on CentOS

By Brian Ryckbost

Get Ruby 1.9.3-p0 installed with libyaml on CentOS to avoid warnings.

Thinking about Ruby's Symbols

By Daniel Morrison

Symbols in Ruby are confusing to new users.

What's "new" in Ruby

By Brian Ryckbost

A quick introduction to Class.allocate, a class method you can use to allocate space for a new object and skip initialization of that object.

Test Multiple Rubies by Combining Bundler and RVM

By Zach Moazeni

I have read several opinions that are either pro-Bundler or pro-RVM, but despite the current debate they do not have to be mutually exclusive.

Command Line Feedback from RVM and Git

By Zach Moazeni

If you’re like me, most of your day is working in Git and RVM. I am frequently typing `git branch` to remember what branch I’m on, and `rvm gemdir` to remember what ruby version and gemset I’m using. With all those wasted cycles, there has to be a better way. And there is.

Rails 3.1 Hackfest this Saturday

By Zach Moazeni

There’s a Rails Hackfest this weekend and we are opening our doors to Rails devs who want to participate.

Speaking and Teaching at Lonestar Ruby Conf

By Zach Moazeni

I’m going to be speaking and teaching at Lonestar RubyConf this year. Look us up if you’re attending.

The Billy Baldwin of Conditional Assignment

By Steve Richert

For those of you who don’t know, Billy Baldwin is the lesser-known and generally-less-useful little brother of famed actor Alec Baldwin.

In the world of Ruby’s conditional assignment operators, ||= is Alec Baldwin; charming and versatile. But not many people know about ||=’s little brother… the &&= operator.

Bundler makes contributing to ruby gems easier

By Zach Moazeni

After using Bundler for the past few months, I love it. It turns managing project dependencies and deployment into a piece of cake. However after coming across a particular dependency declaration, something clicked in my head that made me like it even more.

Clever Custom Datatypes with MongoMapper

By Daniel Morrison

A whole world of rich objects is within your reach with MongoDB.

2010: The Open Source Tools that Made it Great

By Daniel Morrison

My list of open source tools that made a big impact on our work this year.