From the monthly archives:

March 2010

I’ve decided to merge http://charlesmaxwood.com with http://railscoach.com. The efforts on both sites seem to run in parallel with one site providing audio content in the podcast and the other providing content in test.

I feel like I can then focus all of the great stuff I’m doing on this one blog. This provides you a one stop shop and allows me to use this great layout created by Brandon Buttars.

Please feel free to give me feedback on this change.

Also, if you’re consuming the RSS feed, you may need to switch over to use the RailsCoach feed as I’m going to merge the feeds as well.

{ 3 comments }

In this episode, Chad discusses how he broke out of a comfortable job as a forklift operator, which ultimately led to him becoming a programmer.

He discusses his job, Ruby Central, and the Pragmatic Studio as contributions he makes to the community.

We also discuss the ebb and flow of passion for programming and how to avoid burnout on the things that we love. [click to continue…]

{ 4 comments }

I started reading ActiveRecord::Base a few days ago and found 8 things that I didn’t know about that it offered. I also only made it about 1/4 of the way through the code. Here are a few new things I’ve learned upon further reading:

1. Find by multiple ids

Not only can you find a single record by calling find_by_id, you can find multiple records by providing an array of ids.

User.find_by_id([1, 12, 55])
# Returns 3 User objects with ids of 1, 12, and 55. If any isn't found, then RecordNotFound is raised.

2. Locking database records

If you have multiple processes that may update the same record (like incrementing a counter), then you may run into a problem where they both pull the record when the counter = 42. They each update the counter to 43 and save the record. This results in a deviation from reality of 1.

The solution is to lock the record while updating it. Here’s the code: [click to continue…]

{ 1 comment }

RVM is a program that allows you to install and manage multiple versions of Ruby and Gems. This setup is ideal for testing your application or gem (library) against multiple versions of Ruby.

Also, if you’re looking into Rails 3 on Ruby 1.9 this is a great way to try it out.

Are you thinking about moving your application to Ruby 1.9? Do you have a gem or plugin you need to test in multiple Ruby versions?

RVM is your tool. It allows you to manage and install multiple Ruby versions and the gems installed under each version.
Download 118.1 MB
Download (iphone & ipod) 49.6 MB

{ 1 comment }

This week I interviewed Chad Fowler. He and several others have helped organize Ruby conferences around the world, most notably RailsConf, RubyConf, and RubyConf India. He has also written The Passionate Programmer and Rails Recipes. Finally, he has contributed to open source projects like RubyGems and Facebooker.
[click to continue…]

{ 1 comment }

I’ve been trying to read more code lately and figured that I’d be best served by reading code I use frequently. Here are some notes of things I gathered from reading the ActiveRecord base.rb file.
[click to continue…]

{ 10 comments }

Test Driven Development and Behavior Driven Development can be terrific tools in defining your code and ensuring the highest quailty software. In this episode, we discuss the differences between TDD and BDD and what the advantages are to doing them.

We also talk about these test tools:

Download this Episode

{ 2 comments }

Loading multiple Ruby Gems can result in runtime errors when an incompatible version of a gem dependency is already loaded as a dependency of another gem.

Gem bundler can also pre-load and cache gems for faster loading.

Having two gems that require different versions of the same dependency can sometimes cause runtime errors. Yehuda Katz and Carl Lerche have created an elegant solution in the Gem Bundler.
Download 108.8 MB
Download (iphone & ipod) 48.8 MB

{ 0 comments }

Download this Episode

In this episode, we discuss why your application needs tests. Here’s a summary of the thoughts given in this episode:

Why you should test:

1. You know your code works the way you expect.
2. You guarantee that later changes to your code don’t break existing functionality.
3. It documents your code. [click to continue…]

{ 0 comments }


In this screencast, I cover how to use custom Grails configurations along with filters to enable url-based site skins.
Download 98.7 MB
Download (iphone & ipod) 47.8 MB

{ 5 comments }