influitive/apartment — pull request #174 by scottatron (2014-10-13 11:59:25+00:00)
Title: Fix Rake tasks when using Apartment in an engine

I had the same problem described in #155.

This approach makes things a bit more convoluted, but solves the problem of resolving the name of the rake tasks to enhance, as well as checking `Apartment.db_migrate_tenants` at runtime. I found this was necessary as the initializer file was being loaded after the enhancements.