Wednesday, May 16, 2007

All Aboard!

Today at 1pm I started writing our first ruby model object. It is the Item base class and of course it's non trivial as far as model objects go because we have lots of non-standard behavior for it. But I don't like to start with the easy stuff, especially when I'm just learning a new framework and all... At 11pm I had the following working:
  • Item model and schema complete with data migrations so that anyone can start with an empty database
  • CRUD support for Item
  • output as html and xml
  • Items are versioned. The complete edit history is stored in the database (each version is a complete record)
  • Items are "paranoid". This means that when they are deleted, they are not really deleted -- instead the deleted_at timestamp is set.
  • Concurrent editing detection, first submitter wins (error handling needed)
  • textile formatting support
  • listing of items using the xoxo microformat
What we don't have that we should:
  • Version viewing/comparing/reverting from the interface
I took a few breaks for dinner at whatnot. I'd say I spent a sum total of 7 hours "programming" but in actuality, it was about 1 hour of programming and 6 hours of looking up things on websites and doing research on how to use these rails plugins. This included fixing an incompatibility between two of the rails plugins I wanted to use (acts_as_versioned and acts_as_paranoid). it's hard to to much more with items until we make more models. My goal was to get enough underway that we could check in our initial project and set up continuous build, testing, and demo environments. And that, my friends, is why rails is neat. An experienced rails developer would have finished all this before leaving the office and then do something more productive with his/her evening ;-)

No comments: