In a previous post I mentioned just how impressed I was with Ruby on Rails, well I’ve put my money where my mouth is and started contributing. So far I’ve had 3 patches accepted:
I think the relatively small size of the first two patches I submitted is a testament to the well-factored and elegant nature of the rails codebase. The bind variable behaviour is a big change for users, you no longer have to manually escape all the variables, and format them for your database. The adapters & drivers take care of it.
User.find_all([ “first_name = ’%s’ and date_of_birth < ’%s’”, “Michael”, date.strftime(“some_db_format”)
Is now
User.find_all([ “first_name = ? and date_of_birth < ?”, “Michael”, date])
You can also use :first_name and a hash if you’d prefer:
User.find_all([ “first_name=:first_name”, {:first_name=>”Michael Koziarski”}])
Not only is this easier to use, it’s also more secure as the database adapter can ensure it escapes and formats your values safely, thus reducing the risk of a SQL injection attack.
I don’t intend to stop there though, I’m currently working on adding a helper for collections of radio buttons, and a mixin for optimistic locking. David’s got the correct attitude for an open source project maintainer, he accepts patches and provides feedback quickly. Contributors can get up to speed quickly, and feel productive immediately.
If there’s a feature you’d like to see added to rails, add a ticket and if you’re interested in contributing, have a look at the list of open tickets. The more the merrier.
Besides our talk, my most valuable experience at RailsConf was talking with T...
Jamis Buck and I have been writing similar articles lately. We’ve both...