railsdog/spree_landlord — pull request #16 by javidjamae (2013-03-02 18:38:43+00:00)
Title: Changed tenant_finder to raise TenantNotFound when unknown subdomain on master

It doesn't really make sense to have some unknown subdomain on the master domain just render the contents master tenant while leaving the unknown subdomain in the url bar of the browser.

For example, imagine you have a master tenant on ```www.masterdomain.com``` and a subdomain tenant called ```foo.masterdomain.com```.

With the behavior before this pull request, if someone accidentally goes to ```fop.masterdomain.com``` they would see ```fop.masterdomain.com``` in the browser, but they would see the contents of ```www.masterdomain.com```.

After the pull request, if someone goes to ```fop.masterdomain.com```, landlord would raise an error and the application controller for the app can decide what to do: show a 404, redirect to www, lookup from a commonly mispelled subdomain table, etc.