We're hiring!

We're actively seeking developers & designers for our new Detroit location. Learn more

to_api – Simple API Transformations

With Ruby on Rails, it’s trivial to make an XML api. The to_xml method serializes the object’s contents to xml. Call that method from the controller, and you’re done. But what if you want a trimmed down version for your API? That’s easy too, the controller can pass in the attributes it wants. What if…

Read More »

Posted in Tools | Tagged , | 4 Comments

Solving the Knapsack Problem

At Atomic Object we love getting interesting projects that really stretch our abilities. Even so, a real-life NP-complete problem is very rare. Before this project, I hadn’t heard of the knapsack problem. Fortunately, I don’t work alone. I was able to use the Atomic Object brain trust to solve the problem.

Posted in Process & Practices | 5 Comments

Subdomains in Rails

These days Atomic Object has me working on CircleBuilder, a social networking application for faith-based organizations. Each organization gets to set up its own social network. Think Ning for churches. We do this by giving each organization their own subdomain off circlebuilder.com. The most important consideration is that data belonging to one organization must not…

Read More »

Posted in Web | 1 Comment

Deferred Javascript in Rails

Loading javascript at the top or middle of a page can prevent it from loading smoothly. This can make the page appear to freeze halfway through the rendering. You can significantly improve the perceived performance of your application by moving the javascript to the bottom of the page, below all the content it would have…

Read More »

Posted in Web | Tagged | 2 Comments

Saved by Tests – Upgrading to Rails 2.2.2

Two weeks ago, I upgraded a project from rails 2.0.2 to 2.2.2. I had done some polymorphic associations, and I needed more powerful eager loading to prevent N+1 queries. The latest version of rails happens to meet my needs perfectly. I told the customer that this work needed to be done and that it might…

Read More »

Posted in Testing | 16 Comments

Finder Objects in Rails

ActiveRecord is perhaps the most compelling component of Ruby on Rails. ActiveRecord makes it easy to create a record, or to find one, or even to migrate the database schema. Unfortunately those “find” methods can be a little too seductive. Let’s see why.

Posted in Languages, Web | Tagged | 6 Comments

Google I/O Impressions

Atomic Object provides some fantastic benefits. For example, Atomic sends each developer to one conference each year. They pay the registration, air fare, and hotel. They also pay as if I had been actually working. It’s fantastic to have an employer that not only wants me to be a better developer, but takes the extra…

Read More »

Posted in Business of Software, Company, Reviews | Leave a comment

Model Generation – Coding for Simplicity

Rails convention calls for test data to be stored in fixtures. This works very well for the first few iterations, but this approach quickly becomes unwieldy. Often, many records are required, which can lead to poor record names like event_46. Even when naming conscientiously, it’s difficult to give each record a meaningful name in a…

Read More »

Posted in Testing | Tagged | 5 Comments