Jeff Dean's blog



Jeff DeanJeff Dean
ActiveHash 0.9.0 released for Rails 3
edit Posted by Jeff Dean on Tuesday December 07, 2010 at 10:19PM

I recently released active_hash-0.9.0 which should work with Rails 3 / ActiveModel.

If you use previous versions of Rails (down to 2.2.2) it should continue to work as before. If you have any issues, with backward compatibility or otherwise, please report them on GitHub.

Jeff DeanJeff Dean
Tips for writing testable, maintainable page-specific javascript
edit Posted by Jeff Dean on Thursday December 02, 2010 at 09:57PM

I've worked on several large Rails apps and seen at least a dozen javascript systems. In this post I'll describe a few techniques that I've seen that consistently make javascript easier to test and maintain. To those of you who write javascript more than I do, these might be old news, but it's taken me 4 years to learn them!

Jeff DeanJeff Dean
Maintainable State Machines Part 2 - don't store state names in the database
edit Posted by Jeff Dean on Thursday December 02, 2010 at 09:32PM

In relational databases it's common to use foreign keys to reference other tables so that when you make a change to values in the table you maintain referential integrity without paying a performance cost. For some reason, many Rails programmers don't apply this concept to state machines in ActiveRecord. In this post I'll describe the benefits of not storing state names in the database.

Jeff DeanJeff Dean
Maintainable State Machines Part 1 - scopes and predicate methods
edit Posted by Jeff Dean on Thursday December 02, 2010 at 09:02PM

In this post I'll point out a few ways to write maintainable scopes and predicate methods on ActiveRecord objects that use state machines.