How I became convinced to use db:populate instead of db:migrate with inline data seeding, and why you should too.

11 November 2009

0 Comments

How I became convinced to use db:populate instead of db:migrate with inline data seeding, and why you should too.

There’s a lot of established debate and best practice around how to populate your database with the initial reference data it needs in order to operate. I’m not going to rehash that here. If you’re interested in the options available for seeding data, read Luke Franci’s article on Rails Spikes. Many people I work with […]

Continue reading...

MyQuotable.com Source Code released

4 December 2008

6 Comments

A number of VoteFu users have asked me for help integrating VoteFu into their codebase. I recognize that this means I’ve probably left the documentation lacking in a couple of places, but in order to immediately help those folks who want a reference implementation of VoteFu, I am releasing the full source code of MyQuotable.com. […]

Continue reading...

VoteFu 0.0.7

2 December 2008

10 Comments

A couple of contributors forked VoteFu and submitted some patches. I’ve updated the master branch to integrate the changes. Notably: VoteFu now works as a standard gem in a Ruby application. (i.e. not as a Rails plugin) VoteFu now works as a Rails Gem Plugin. VoteFu now works with Rails 2.2.2. Other assorted small bugfixes. […]

Continue reading...

VoteFu gets a couple enhancements

23 July 2008

3 Comments

The lastest version of VoteFu has a few useful enhancements: Protect against mass assignment forgery. The params hash will only be consulted for :vote => true or false. The rest has to be assigned in the controller. The acts_as_voteable mixin now has support for tallying votes. The documentation will be updated tonight, but briefly, here […]

Continue reading...

You are invited to my open alpha of MyQuotable.com

21 July 2008

4 Comments

Quotes. I love quoting people. I have a ton of quotes saved in text files, on my blog, in my various mood messages on IM platforms, and who-know-where-else. I decided to build an application to manage, organize, and syndicate quotes. You can read more about it on my project page for MyQuotable. If you read […]

Continue reading...

Rails 2.1 nested routes and complex nestings

8 June 2008

0 Comments

The new Rails routing has nice support for nested reources. And, I think it handles just enough nesting. Any more support, and it’s possible to go overboard and write ugly code. For example, here is what Rails now supports for nested routing syntax: 1 2 3 4 5 # Simple parent child association map.resources :user, […]

Continue reading...

Oops. Forgot to Freeze my Gems.

6 June 2008

0 Comments

Sorry for the outage on this blog yesterday. My hosting provider upgraded to Rails 2.1, and I had cleverly forgotten to: bash# rake freeze:rails:gems If this happens to you, and you make the unfortunate mistake of trying to instead update Typo to Rails 2.1 using: bash# rake rails:update You’ll be in even worse trouble, unless […]

Continue reading...

Sidebar comments in code

26 May 2008

2 Comments

In my post about clever code vs. terse code, I showed some distaste for code that attempts to put a bunch of logical statements on one line. I have a particular coding prejudice that lines of code should be short from left-to-right, if at all possible. The reason? I like sidebar comments. Maybe this is […]

Continue reading...

Simple and Terse Vs. Too Clever

26 May 2008

34 Comments

In 21 Ruby Tricks You Should Be Using In Your Own Code, Peter Cooper outlines some really useful best practices that programmers could benefit from. However, I think that there’s a tendency to over-obfuscate code from time to time in the Ruby world. I like terse code. I like beautiful code. But I dislike tricky […]

Continue reading...

Ruby Gem – Threaded Collections: Process collections over many threads

8 May 2008

7 Comments

I often have to iterate over a collection and perform some remote, or long running task on each member of the collection. Threaded Collections is a package for iterating through collections over multiple threads. With large collections, sometimes it can be more efficient to process a collection in parallel, provided that the collected items don’t […]

Continue reading...