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...4 December 2008
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...2 December 2008
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. To install VoteFu as a [...]
Continue reading...23 July 2008
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 is what you [...]
Continue reading...21 July 2008
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 this [...]
Continue reading...8 June 2008
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, :has_many => :posts [...]
Continue reading...6 June 2008
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 you’re prepared to do [...]
Continue reading...26 May 2008
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 my showing [...]
Continue reading...26 May 2008
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...8 May 2008
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 have [...]
Continue reading...
11 November 2009
Comments