Daily log - April 13, 2009

Inspired by Clinton Nixon, I’m going to start writing daily logs of things I’ve learned or am thinking about. Hopefully it will turn into a good habit!

Rails arcana: Don’t specify :method => :get as an option to a custom route if you want to filter by HTTP method. Use :conditions => {:method => :get}, or your controller test will complain about not having a route to that action. Personally, I think this is unintuitive, but a minor point at best.

Cucumber and Textmate: To run Cucumber features properly in TextMate, I had to modify the default bundle. First it was running ./script/cucumber.rake (why?), from which I removed .rake. I also added -r features as a command line parameter so it would require all my step definitions.

To shard or not to shard: I had an interesting discussion with James Avery and Mark Imbriaco about running multi-tenant apps and database sharding. The consensus was don’t worry about sharding at first – let database scaling issues drive the decision. Also, 37signals apps manually scope each query by account. Seems it will be a decent amount of work to implement this when my latest project is ready for more than one tenant. Luckily, we won’t have to worry about this until we prep the fall release of the software.

Allez cuisine!: I got some kudos from Adam Jacob for my RSpec skills — “you are an rspec pimp” — apparently because I rewrote a number of the specs he had written to be less coupled to the implementation. He wants to run a conference call soon to help new Chef contributors get up to speed with RSpec, and wants me on it to at least “call [him] on stupid stuff”. Looking forward to this!