Multitenancy with Rails by Ryan Bigg http://leanpub.com/multi-tenancy-rails