Internet Asshattery

Posted by Kerry Sat, 26 Apr 2008 10:43:00 GMT

Leonard Lin: Internet Asshattery, Armchair Scaling Experts Edition

Rails Scaffold, ActiveRecord, and table names 4

Posted by Kerry Mon, 21 May 2007 19:36:00 GMT

Looks like the Rails scaffolding doesn’t like it when your model uses a different table name from the default mapping it expects(like when accessing a legacy database model).

So if you have a model like so:

class Thing < ActiveRecord::Base
    set_table_name "some_thing"
end

Then ActiveRecord will be expecting a table called “some_thing”, however the scaffolding generator is expecting the default, which is going to be “things”(or something like that since I can’t be bothered actually generating a model called Thing).

When running your generator you’re going to end up with an error like:

error  Before updating scaffolding from new DB schema, try creating a table for your model (Thing)

Annoying as this is, you can work around it by temporarily creating the table required by the generator. Then go ahead and drop it after the generator works.

create table things ();

I’m not sure what longer term effects this causes, and if there is a better way then let me know.

Scaling Twitter

Posted by Kerry Sun, 06 May 2007 17:49:00 GMT

Blaine Buxton’s slides on scaling twitter.

Seaside and Rails

Posted by Kerry Mon, 05 Mar 2007 22:00:00 GMT

James Shell: Seaside, Rails, Helpers…

It’s not XML, YAML, An Array or list. It doesn’t get translated into any structure like that.

A Rails Debugger

Posted by Kerry Sun, 04 Feb 2007 11:14:00 GMT

Gyre: simple, fast, cross-platform, web-centric, open source, and written in Ruby.

Good idea, hope it works out.