spree/spree — pull request #4415 by cbrunsdon (2014-03-10 08:56:15+00:00)
Title: Create Store model

As discussed at railsconf, this is an model I think we need in spree for multiple reasons:

1. It provides a common point for different multi-tenant solutions to extend
2. It gives us a more coherent place to put configuration variables than throwing them on Spree::Config (and makes them work in mutli-tennant solutions)
3. Existing almost as reproduced in many stores and extensions already

Keep in mind as of right now this does not cover:

1. Domains, or anything related. It is not opinionated on what store should be used at any given time
2. Currencies. I attempted to start overriding Spree::Config[:currency] to return the first store's currency and ran into countless problems. I will continue to work on this, but I think its still a good start point even though it does not deprecate Spree::Config[:currency]. I left the attribute on the model as I do think thats what people should be extending.
3. Remove of all references to old-style configuration. Right now I just throw deprecation warnings, but will work on removing more and more of them in future commits.

Anyway, still needs some work but I wanted to get something up so everyone has a chance to see where this is. The ugliest stuff is in providing the compatibility with Spree::Config preferences, so suggestions are more than welcome there.