Colorized SQL Log Backport for ActiveRecord

One of the new features of Rails 5 will be granular SQL logging so you can easily see SELECT, INSERT, UPDATE, DELETE, and TRANSACTION statements in your log. For example: But why let Rails 5 have all the fun? Today I created a gem that allows you to leverage this feature now. The gem is currently compatible and tested for Rails 3.2 to 4.2. Get it here and happy logging!

Read More

I have the PR!

We recently implemented a stronger, more active, pull request culture at CustomInk, as part of our deploy process. As you may already know, a pull request is a feature on Github that broadcasts to others that you would like to have your changes merged into an upstream project. [note: Turns out it's built into git itself http://git-scm.com/docs/git-request-pull]. We find that it's great for learning what other engineering teams are working on. It's also a great opportunity to share knowledge.

Read More

Rails Multi-Database Best Practices Roundup

Since landing my first job programming with Ruby, most Rails applications I have worked with have managed two or more database connections. Often times these connections are both readable and writable. Collectively they represent a comprehensive business domain. Today I would like to cover everything I know about this topic, without going into the bike shed of micro services or schema management gems. The goal is simple! To give you the tools you need to keep your application running smoothly...

Read More

Ruby's Private is for Methods Only

The other day I saw a pull request, on a Rails project, that declared a private inner class. Having my fair share of experience with Java, I am very familiar with the construct. Essentially, you declare one class inside of another class and declare it as private. This is often done to clean up your internal data structures and hide the implementation details from others. I couldn't recall ever seeing this in Ruby before, so it gave me pause. As...

Read More

Ruby Pretzel Colons

The Ruby Pretzel Colon is one of my favorite idioms. But it's salty goodness can be an acquired taste for new Ruby programmers. There seems to be an aversion to it's apparent magic. It is an unusual syntax. But it is easy to understand if you break it down into it's parts.

Read More

To the Cloud!

This month, WebOps overcame one of our final hurdles to rid ourselves of managing hardware, joining the likes of Netflix, AirBnB, and Dropbox in the cloud. We had been on a steady migration path and each step of the way, it has been a win for everyone; WebOps, Developers, Business Customers and most importantly, our customers. CustomInk now has more server capacity at it’s disposal than AOL when I left in 2010 all for an incremental hourly fee.

Read More

Customizing Rake Tasks In Rails 4.1 And Higher

I have been overriding, invoking, and executing custom Rake tasks since I was an early Ruby developer. Tweaking your project's automated tasks are likely the closest thing Rails developers come to building their own light saber. Most popular are adding or changing how the Rails test suite behaves. For example, adding Capybara to your project. Recently I have been upgrading projects from 3.2 to 4.2 and one thing that really stood out to me was how Rails testing tasks are...

Read More