Rails and DB2 … cool, but what were the Ruby guys smokin’?
January 15, 2008
There I was coding away a chapter for the new book (Beginning DB2, released by Apress if you must know), when I realised Rails had some cool features, but this wasn’t one of them.
If I want to use Rails’ neat scaffolding feature to throw up a framework for a table
ruby script/generate scaffold thing
Then I have to define my ActiveRecord in a half-assed, stupidest-idea-ever plural form.
class ThingTable < ActiveRecord::Migration
def self.up
create_table :things do |t|
t.column :thingname, :string, :null => false
t.column :description, :string
t.column :value, :integer
end
end
def self.down
drop_table :things
end
end
You read that right, fellow starship troopers. Random pluralisation for fun and profit. Do you think the Rails designers were savvy enough to ensure correct pluralisation? How about Schema/Schemata … Octopus/Octopodes … Sheep/Sheep … or Gateau/Gateaux ? Oh, wait, I’m sure Rails would spell that last one “Ghetto”. 😛
Howdy, didn’t know about your other blog, which is why I’m commenting on such an old post…
You can customize the pluralization! (You can also turn it off…)