Coder Social home page Coder Social logo

rasoolkhan / spree-multi-vendor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chamnap/spree-multi-vendor

0.0 2.0 0.0 96 KB

This extension allows a single Spree instance to run multi stores for different vendors (i.e. multi-store, mulit-vendor).

License: BSD 3-Clause "New" or "Revised" License

Ruby 100.00%

spree-multi-vendor's Introduction

SpreeMultiVendor

This extension allows a single Spree instance to run multi stores for different vendors (i.e. multi-store, mulit-vendor).

What this extension does is basically managing database connections, i.e. each store has its own database. This extension also add rake scripts to do migration on multiple databases.

You can have only one database in test and database environment.

Usage

Add the key database_prefix on database.yml (production environment) as below:

production:
    database_prefix: ecommerce_
    adapter: mysql2
    encoding: utf8
    reconnect: false
    pool: 5
    username: root
    password: xxxxxx

When the request comes in, it'll make the connection based on the domain name (eg. example.com). In this case, it'll connect to the database named "ecommerce_example_com". If that database doesn't exist, it'll render page not found.

There are three rake scripts available to do migration on multiple databases:

rake multi:db:migrate (options: VERSION=x, VERBOSE=false)
rake multi:db:migrate:up (options: VERSION=x, VERBOSE=false)
rake multi:db:migrate:down (options: VERSION=x, VERBOSE=false)

Copyright (c) 2011 chamnap, released under the New BSD License

spree-multi-vendor's People

Contributors

chamnap avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.