Rails Engine for multitenancy from the Multitenancy With Rails eBook by Ryan Bigg