OPML in Browsers Dead users.
Oct 13

Naked Active Records

Ruby, Tech Add comments

I had a weird dream last night (literally a dream, not in the MLK sense). In the dream I was building a Rails app (I know, couldn’t I think about more interesting / racy things?) and the designer for the project got hit by a bus.

Instead of finding another designer, I delivered the UI that was already built. No, not even Streamlined but instead:


% ruby script/console

I didn’t JUST give them the command line, I also had a piece of paper that listed the domain models and documentation for them to grok, but even that told them how to look at methods on the objects to delve deeper.

This is Naked Objects taken to the extreme, but a lot of us probably use this “UI” don’t we?

This is because the developers of the application put the power in power users. We have to know everything about the system, and often have to dig deep into the system to fix bugs and such.

script/console is my best friend. It means that I do not have to drop to SQL to poke around my DB. Instead I have a more powerful tool to munge the data, in a language that I prefer for day to day tasks. Also, it means that I do not bypass any validation / business logic when playing with the data. I have known many a project that has SQL loading scripts that end up being invalid when business logic changes (and this logic wasn’t constrained in the DB).

Writing scripts that use the bootstrapping is great too. Now instead of doing a bunch of work in Ruby and then dropping to SQL, you can stay in Ruby land and it will do the hard work for you.

So, here is to script/console. The power users tool.

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: Type in the word 'ajax'