First, I'd to extend a big thanks to Joe and Jim for giving me a ride to the conference today.
The two tutorials I decided to attend today were:
"The Advanced ActiveRecord Workshop" with Gregg Pollack & Jason Seifer (the Rails Envy Guys) and "The Ins and Outs of Ruby I/O" with James Edward Gray II and Gregory Brown. Both of which were excellent.
The Advanced ActiveRecord Workshop covered:
- Loading large data sets (the 'ar-extensions' gem helps lots).
- A gentle reminder to properly index your freakin' database.
- How Rails optimizes multiple :includes in finds and how that goes to hell if you combine lots of :includes with :conditions
- The super awesome Named Scopes (which you need to look up right now, if you haven't already because it's not just about defining custom finders -- it's about defining custom finders that you can chain together and get optimized queries)
- Polymorphic Associations, Single Table Inheritance, Dirty Fields, Association Proxies, Callbacks, and creating AR plugins.
The Ins and Outs of Ruby I/O was also very informative. Since Ruby has such easy file IO it's easy to forget about the underlining structures and the problems that can crop up. Topics include:
- The most efficient way to read in a file (generally foreach)
- Random access inside a file
- Overcoming buffering problems with file.fsync || file.flush (fsync returns nil if it doesn't work)
- A resonably through regex explanation
- A compare and contrast of how to handle unicode on Ruby 1.8 vs Ruby 1.9
- How to use Marshall or Yaml to serialize your objects.
Later we had some excellent Bar-B-Q at Rudy's and discussed how the hell the Ruby world is going to migrate from 1.8.x to 1.9. We had no good solutions. The Bar-B-Q was excellent, however, so we left in good spirits.
Tomorrow I'll be speaking at 1:30 on "Using Metrics to Take a Hard Look at Your Code" so I'm pretty excited as this will be the first mass presentation of this talk and I think its turned out nicely.