Code Monkey home page Code Monkey logo

spree_multi_tenant's People

Contributors

javidjamae avatar racx avatar ramprasadg avatar stefansenk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spree_multi_tenant's Issues

Missing instructions on how to set up dummy app

I'm trying to fork the project to see if I can get it to work with spree 1.2.0, but when I try to run rspec, I get this error:

/xxxx/spree_multi_tenant/spec/spec_helper.rb:4:in `require': cannot load such file -- /xxxx/spree_multi_tenant/spec/dummy/config/environment.rb (LoadError)

I noticed that this is in your .gitignore, but you don't have any directions on how to set up the dummy app in the readme file. Perhaps you could explain?

Thanks!

Not compatible with spree 3.1.0

Hello Team,

I am implementing my store using spree 3.1.0 and trying to add integrate spree_multi_tenant
getting below error -

Bundler could not find compatible versions for gem "spree_core":
  In snapshot (Gemfile.lock):
    spree_core (= 3.1.5)
  In Gemfile:
    spree (~> 3.1.0) was resolved to 3.1.5, which depends on
      spree_core (= 3.1.5)
    spree (~> 3.1.0) was resolved to 3.1.5, which depends on
      spree_core (= 3.1.5)
    spree (~> 3.1.0) was resolved to 3.1.5, which depends on
      spree_core (= 3.1.5)
    spree (~> 3.1.0) was resolved to 3.1.5, which depends on
      spree_core (= 3.1.5)
    spree (~> 3.1.0) was resolved to 3.1.5, which depends on
      spree_core (= 3.1.5)
    spree_multi_tenant was resolved to 0.4.0, which depends on
      spree_core (~> 2.2.0)

Could you please help me so I can integrate spree_multi_tenant
If you need more information please let me know.

Not able to run app on localhost

Hi,
I followed all steps but not able to run app on localhost.
What steps should I follow to do that

I get

RuntimeError in Spree::HomeController#index

DomainUnknown

Spree::Product does not recognise master

I created a tenant and added tenant_id: 1 to all the default products that Spree comes with. Now browsing to `/admin/products' gives

Spree::Product#master_images delegated to master.images, but master is nil: #<Spree::Product id: 7, name: "Apache Baseball Jersey", description: "Aut enim vero aperiam aut ipsam quaerat veritatis e...", available_on: "2014-04-14 08:40:27", deleted_at: nil, slug: "apache-baseball-jersey", meta_description: nil, meta_keywords: nil, tax_category_id: 1, shipping_category_id: 1, created_at: "2014-04-14 08:40:28", updated_at: "2014-04-14 09:18:47", tenant_id: 1>

The only similar issue I could find is spree/spree#2697 by @harssh who I assume faced similar issue while using this gem as he has added a couple of other issues here too.

Should Spree::Role be a tenanted model?

I think that I am missing something because I do not get which the point is for Spree::Role to be a tenanted model

If I create a new Tenant, authorization will fail, since I need to create new roles for it. Maybe I am missing something, but I think that roles should be the same for all the tenants unless they are customizable by tenant, which they are not, right now, aren't they?

Running "rake spree_multi_tenant:create_tenant_and_assign" fails because StockMovement is read-only

I created a fresh Rails app, installed spree, installed spree_multi_tenant following the instructions in the readme. Using Rails 4.0.4 and Ruby 2.0.0.

When I run the create_tenant_and_assign, the variants don't get assigned a tenant_id because it fails at StockMovement because it is read only:

Spree::StockMovement Load (0.2ms) SELECT "spree_stock_movements".* FROM "spree_stock_movements"
(0.0ms) begin transaction
(0.0ms) rollback transaction
ActiveRecord::ReadOnlyRecord: ActiveRecord::ReadOnlyRecord

This appears to be the only field with the problem, when I run this code in the console and skip StockMovement, it completes successfully.

I am new to Spree so I can't offer any suggestions or a patch...

ActionView::Template::Error (Mysql2::Error: Unknown column 'spree_promotion_rules.tenant_id' in 'where clause': SELECT `spree_product_promotion_rules`.* FROM `spree_product_promotion_rules` WHERE `spree_promotion_rules`.`tenant_id` = 3 AND `spree_product_promotion_rules`.`product_id` IN (18, 19)):

i'm getting this error, is there any way to use this with spree 3-1-stable ??

  Spree::Product Load (1.6ms)  SELECT  DISTINCT `spree_products`.* FROM `spree_products` INNER JOIN `spree_variants` ON `spree_variants`.`product_id` = `spree_products`.`id` AND `spree_variants`.`is_master` = 1 AND `spree_variants`.`deleted_at` IS NULL AND `spree_variants`.`tenant_id` = 3 INNER JOIN `spree_prices` ON `spree_prices`.`variant_id` = `spree_variants`.`id` AND `spree_prices`.`deleted_at` IS NULL WHERE `spree_products`.`deleted_at` IS NULL AND `spree_products`.`tenant_id` = 3 AND (`spree_products`.discontinue_on IS NULL or `spree_products`.discontinue_on >= '2017-01-23 18:56:13.025204') AND (`spree_products`.discontinue_on IS NULL or `spree_products`.discontinue_on >= '2017-01-23 18:56:13.028759') AND (`spree_products`.available_on <= '2017-01-23 18:56:13.028733') AND `spree_products`.`tenant_id` = 3 AND (spree_prices.amount IS NOT NULL) AND `spree_prices`.`currency` = 'USD' LIMIT 12 OFFSET 0
  Spree::ProductPromotionRule Load (2.0ms)  SELECT `spree_product_promotion_rules`.* FROM `spree_product_promotion_rules` WHERE `spree_promotion_rules`.`tenant_id` = 3 AND `spree_product_promotion_rules`.`product_id` IN (18, 19)
  Rendered /Users/mezbah/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spree_frontend-3.1.3/app/views/spree/shared/_products.html.erb (148.3ms)
  Rendered /Users/mezbah/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spree_frontend-3.1.3/app/views/spree/home/index.html.erb within spree/layouts/spree_application (565.7ms)
Completed 500 Internal Server Error in 1155ms (ActiveRecord: 312.1ms)

ActionView::Template::Error (Mysql2::Error: Unknown column 'spree_promotion_rules.tenant_id' in 'where clause': SELECT `spree_product_promotion_rules`.* FROM `spree_product_promotion_rules` WHERE `spree_promotion_rules`.`tenant_id` = 3 AND `spree_product_promotion_rules`.`product_id` IN (18, 19)):
    18: 
    19: <% if products.any? %>
    20:   <div id="products" class="row" data-hook>
    21:     <% products.each do |product| %>
    22:       <% url = spree.product_path(product, taxon_id: @taxon.try(:id)) %>
    23:       <div id="product_<%= product.id %>" class="col-md-3 col-sm-6 col-xs-6 product-list-item" data-hook="products_list_item" itemscope itemtype="https://schema.org/Product">
    24:         <div class="panel panel-default">
  mysql2 (0.4.5) lib/mysql2/client.rb:120:in `_query'
  mysql2 (0.4.5) lib/mysql2/client.rb:120:in `block in query'
  mysql2 (0.4.5) lib/mysql2/client.rb:119:in `handle_interrupt'
  mysql2 (0.4.5) lib/mysql2/client.rb:119:in `query'
  activerecord (4.2.7.1) lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `block in execute'
  activerecord (4.2.7.1) lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'

multitenant_decorator.rb and Raketask Error

Hi ,
Thanks for the awesome app.
I am new to Ruby on Rails.
I followed the instruction and manually created multitenant_decorator.rb and tenant.rake file under lib/task

I get following error.

Last login: Tue Jul 23 09:45:35 on ttys000
MACPRO:~ CloudInnovates$ cd store
MACPRO:store CloudInnovates$ subl ~/store/
MACPRO:store CloudInnovates$ rails server
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/CloudInnovates/store/app/models/multitenant_decorator.rb:2:in <top (required)>': uninitialized constant Spree::Page (NameError) from /Users/CloudInnovates/store/config/application.rb:18:inblock (2 levels) in class:Application'
from /Users/CloudInnovates/store/config/application.rb:17:in glob' from /Users/CloudInnovates/store/config/application.rb:17:inblock in class:Application'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:506:in _run__491926929473687932__prepare__39056507203998318__callbacks' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in__run_callback'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in _run_prepare_callbacks' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:inrun_callbacks'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.13/lib/action_dispatch/middleware/reloader.rb:74:in prepare!' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.13/lib/action_dispatch/middleware/reloader.rb:48:inprepare!'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/application/finisher.rb:47:in block in <module:Finisher>' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:30:ininstance_exec'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:30:in run' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:55:inblock in run_initializers'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:54:in each' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:54:inrun_initializers'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/application.rb:136:in initialize!' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:inmethod_missing'
from /Users/CloudInnovates/store/config/environment.rb:5:in <top (required)>' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/polyglot-0.3.3/lib/polyglot.rb:63:inrequire'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/polyglot-0.3.3/lib/polyglot.rb:63:in require' from /Users/CloudInnovates/store/config.ru:3:inblock in

'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:51:in instance_eval' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:51:ininitialize'
from /Users/CloudInnovates/store/config.ru:in new' from /Users/CloudInnovates/store/config.ru:in'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:40:in eval' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:40:inparse_file'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:200:in app' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands/server.rb:46:inapp'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:304:in wrapped_app' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:254:instart'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in start' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:55:inblock in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:50:in tap' from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:50:in<top (required)>'
from script/rails:6:in require' from script/rails:6:in'
MACPRO:store CloudInnovates$

I have also added spree multi domain - https://github.com/spree/spree-multi-domain

none of this both works.

Please Advice

Regards

Not compatible with spree 3.7.0 or upgraded versions

HI Team,

I tried using this gem in my latest rails application having following gems specifications. But its not letting us to be used.

ruby '2.5.3'
gem 'rails', '~> 5.2.3'
gem 'spree', github: 'spree/spree'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise'
gem 'spree_multi_tenant', github: 'stefansenk/spree_multi_tenant'

and it gives error like below

Bundler could not find compatible versions for gem "spree_core":
  In Gemfile:
    spree was resolved to 4.0.0.alpha, which depends on
      spree_core (= 4.0.0.alpha)

    spree_multi_tenant was resolved to 0.4.0, which depends on
      spree_core (~> 2.2.0)

Let me know if any other information you need. Please help me to setup this gem in my application. Thanks in advance

Question about the source code

I don't seem to find where you redirect asset requests to app/assets/stylesheets/tenants/mydomain.css
app/assets/javascripts/tenants/mydomain.js

How can I give a facility to add a tenant dynamically?

My client want to create multi merchant site using spree. I give him the solution for this gem. but as I and my client found that here is no any facility to create a tenant dynamically. we have to run a rake command to create every tenant and client have to depend on the developer to create every tenant. Do we have any solution for this?

And I need to use this gem with spree-2-4, do your team working on this or I'll fork this and update for spree-2-4

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.