Tossed Salad
I’ve been keeping myself user busy the last few weeks and haven’t made the time to post anything.
- RailsConf 2006 is only 5 days away. I'm flying. While the ArgonExpress would be a good opportunity to hang out with the cool kids, I can't stomach the thought of being stuck in on a train for several days. I hope they make it to Chicago alive.
- The server migration is almost complete. Last night I installed lighttpd on the new box, setup Apache to proxy requests to the Rails sites running under lighttpd, and migrated all of the Subversion repositories. There is only one site left to move. Just waiting on the client.
- I've written a lot of stuff in Rails over the last several weeks which may be useful to others. I'll try to package these up and post them before or during RailsConf:
- Global unit tests: Tests that are defined in one place that will run for any ActiveRecord model with the right attributes. So far I have test_acts_as_versioned, test_optimisitic_locking, and test_fixtures_loaded_for_all_associations. The last one is very handy. It reflects on all associations and gives you a list of fixtures that need to be defined in each unit test.
- Plugin: update_attributes_if_changed. Only updates the attributes if anything has changed. If you are using update_attributes on models with updated_at columns and acts_as_versioned you'll want this.
- ActiveRecord synchronizer: One way synchronization with data transformations, conditions, defaults, etc. Very handy for synchronizing with legacy databases. Complete with DSL.
- Datadumper plugin: Dump data in several format, but mosty used for dumping data into a format usable in migrations. Especially nice for prepopulating domain tables using migrations.
- Validation: validates_association. Not to be confused with validates_associated. Validates_association validates that the associated object is of the correct class as specified in the association declaration.
- Surprisingly, I found out that I really like watching soccer.