Skip to content

Commit

Permalink
Change for Spree version 4.5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
earllevine committed May 13, 2023
1 parent ff230ce commit 03cbeb6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.5
3.2.2
11 changes: 6 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ git_source(:github) do |repo_name|
"https://github.com/#{repo_name}.git"
end

gem 'spree_core', '4.4.0'
gem 'spree_backend', '4.4.0'
gem 'spree_frontend', git: 'https://github.com/spree/spree_legacy_frontend.git', ref: 'c81ce5c'
gem 'spree_emails', '4.4.0'
gem 'spree_core', '4.5.0'
gem 'spree_backend', '4.5.0'
gem 'spree_frontend', '4.5.0'
gem 'spree_emails', '4.5.0'
# Provides basic authentication functionality for testing parts of your engine
gem 'spree_auth_devise', '4.4.2'
gem 'spree_auth_devise', '4.5.0'
gem 'rails-controller-testing'

gem 'sqlite3', '~> 1.4'
Expand All @@ -21,6 +21,7 @@ gem 'rubocop-rspec', require: false
group :test do
gem 'pg'
gem 'redis', '4.4.0'
gem 'email_spec', '2.2.1'
end

gemspec
11 changes: 9 additions & 2 deletions lib/spree_multi_tenant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,29 @@ def self.tenanted_models
[
'Spree::CmsPage',
'Spree::CmsSection',
'Spree::Digital',
'Spree::DigitalLink',
'Spree::Menu',
'Spree::MenuItem',
'Spree::PaymentSource',
'Spree::StoreProduct',
'Spree::Tag',
'Spree::User',
'Spree::Tag'
'Spree::Webhooks::Event',
'Spree::Webhooks::Subscribers',
'Spree::WishedItem',
'Spree::Wishlist'
].map(&:safe_constantize).compact
end

def self.tenanted_controllers
[
Spree::BaseController,
Spree::Api::BaseController,
Spree::Api::V2::BaseController
] +
[
'Spree::Admin::BaseController',
'Spree::Api::BaseController',
'Spree::StoreController',
'Spree::UserPasswordsController',
'Spree::UserSessionsController',
Expand Down
8 changes: 4 additions & 4 deletions spec/models/preferences_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
@tenant2 = FactoryBot.create(:tenant)

SpreeMultiTenant.with_tenant @tenant1 do
Spree::Api::Config[:requires_authentication] = true
Spree::Api::Config[:api_v2_per_page_limit] = 1
end
SpreeMultiTenant.with_tenant @tenant2 do
Spree::Api::Config[:requires_authentication] = false
Spree::Api::Config[:api_v2_per_page_limit] = 2
end
end

it "should have the right preference for the tenant" do
SpreeMultiTenant.with_tenant @tenant1 do
Spree::Api::Config.requires_authentication.should == true
Spree::Api::Config.api_v2_per_page_limit.should == 1
end
SpreeMultiTenant.with_tenant @tenant2 do
Spree::Api::Config.requires_authentication.should == false
Spree::Api::Config.api_v2_per_page_limit.should == 2
end
end
end

0 comments on commit 03cbeb6

Please sign in to comment.