Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.

Commit 15d7431

Browse files
Merge pull request #464 from spark-solutions/feature/rails-6-0
Rails 6.0 and Spree 4.0 support
2 parents e44f653 + 1d935d0 commit 15d7431

15 files changed

Lines changed: 69 additions & 20 deletions

.travis.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ script:
77

88
addons:
99
chrome: stable
10+
postgresql: 9.4
1011

1112
env:
1213
- DB=mysql
@@ -23,16 +24,27 @@ gemfile:
2324
- gemfiles/spree_3_2.gemfile
2425
- gemfiles/spree_3_5.gemfile
2526
- gemfiles/spree_3_7.gemfile
27+
- gemfiles/spree_4_0.gemfile
2628
- gemfiles/spree_master.gemfile
2729

2830
matrix:
2931
allow_failures:
3032
- gemfile: gemfiles/spree_master.gemfile
3133
exclude:
32-
- rvm: 2.3.7
33-
gemfile: gemfiles/spree_master.gemfile
34-
- rvm: 2.4.4
35-
gemfile: gemfiles/spree_master.gemfile
34+
- rvm: 2.3.7
35+
gemfile: gemfiles/spree_4_0.gemfile
36+
- rvm: 2.4.4
37+
gemfile: gemfiles/spree_4_0.gemfile
38+
- rvm: 2.3.7
39+
gemfile: gemfiles/spree_master.gemfile
40+
- rvm: 2.4.4
41+
gemfile: gemfiles/spree_master.gemfile
42+
- rvm: 2.5.1
43+
gemfile: gemfiles/spree_3_2.gemfile
44+
- rvm: 2.5.1
45+
gemfile: gemfiles/spree_3_2.gemfile
46+
- rvm: 2.5.1
47+
gemfile: gemfiles/spree_3_5.gemfile
3648

3749
before_install:
3850
- mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"

Appraisals

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ appraise 'spree-3-5' do
99
end
1010

1111
appraise 'spree-3-7' do
12+
gem 'sass-rails'
1213
gem 'spree', '~> 3.7.0.rc3'
1314
gem 'rails-controller-testing'
1415
end
1516

17+
appraise 'spree-4-0' do
18+
gem 'spree', github: 'spree/spree', tag: 'v4.0.0.beta'
19+
gem 'rails-controller-testing'
20+
end
21+
1622
appraise 'spree-master' do
1723
gem 'spree', github: 'spree/spree', branch: 'master'
1824
gem 'rails-controller-testing'

config/locales/en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ en:
4141
user_registrations:
4242
destroyed: Bye! Your account was successfully cancelled. We hope to see you again soon.
4343
inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
44+
signed_up_but_unconfirmed: You have signed up successfully.
4445
signed_up: Welcome! You have signed up successfully.
4546
updated: You updated your account successfully.
4647
user_sessions:

gemfiles/spree_3_7.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ source "https://rubygems.org"
44

55
gem "rails-controller-testing"
66
gem "spree", "~> 3.7.0.rc3"
7+
gem "sass-rails"
78

89
gemspec path: "../"

gemfiles/spree_4_0.gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails-controller-testing"
6+
gem "spree", github: "spree/spree", tag: "v4.0.0.beta"
7+
8+
gemspec path: "../"

lib/controllers/backend/spree/admin/admin_resource_controller_decorator.rb

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/controllers/backend/spree/admin/admin_controller_decorator.rb renamed to lib/controllers/backend/spree/admin/base_controller_decorator.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Spree::Admin::BaseController.class_eval do
1+
module Spree::Admin::BaseControllerDecorator
22
# Redirect as appropriate when an access request fails. The default action is to redirect to the login screen.
33
# Override this method in your controllers if you want to have special behavior in case the user is not authorized
44
# to access the requested action. For example, a popup window might simply close itself.
@@ -22,3 +22,4 @@ def model_class
2222
nil
2323
end
2424
end
25+
Spree::Admin::BaseController.prepend(Spree::Admin::BaseControllerDecorator)

lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
Spree::Admin::Orders::CustomerDetailsController.class_eval do
2-
before_action :check_authorization
1+
module Spree::Admin::Orders::CustomerDetailsControllerDecorator
2+
3+
def self.prepended(base)
4+
base.before_action :check_authorization
5+
end
36

47
private
58

@@ -14,3 +17,4 @@ def check_authorization
1417
authorize! action, resource, session[:access_token]
1518
end
1619
end
20+
Spree::Admin::Orders::CustomerDetailsController.prepend(Spree::Admin::Orders::CustomerDetailsControllerDecorator)

lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb renamed to lib/controllers/backend/spree/admin/orders_controller_decorator.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
Spree::Admin::OrdersController.class_eval do
2-
before_action :check_authorization
1+
module Spree::Admin::OrdersControllerDecorator
2+
3+
def self.prepended(base)
4+
base.before_action :check_authorization
5+
end
36

47
private
58

@@ -19,3 +22,4 @@ def check_authorization
1922
end
2023
end
2124
end
25+
Spree::Admin::OrdersController.prepend(Spree::Admin::OrdersControllerDecorator)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Spree::Admin::ResourceControllerDecorator
2+
def self.prepended(base)
3+
base.rescue_from CanCan::AccessDenied, with: :unauthorized
4+
end
5+
end
6+
Spree::Admin::ResourceController.prepend(Spree::Admin::ResourceControllerDecorator)

0 commit comments

Comments
 (0)