Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 7 support #552

Merged
merged 3 commits into from
Dec 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ run_tests: &run_tests
keys:
- spree-auth-devise-bundle-v9-ruby-2-7-{{ .Branch }}
- spree-auth-devise-bundle-v9-ruby-2-7
- run:
name: Install libvips
command: sudo apt-get install libvips
- run:
name: Set bundle path
command: bundle config --local path vendor/bundle
Expand Down Expand Up @@ -58,6 +61,9 @@ run_tests_3_0: &run_tests_3_0
keys:
- spree-auth-devise-bundle-v9-ruby-3-0-{{ .Branch }}
- spree-auth-devise-bundle-v9-ruby-3-0
- run:
name: Install libvips
command: sudo apt-get install libvips
- run:
name: Set bundle path
command: bundle config --local path vendor/bundle
Expand Down Expand Up @@ -91,6 +97,9 @@ jobs:
keys:
- spree-auth-devise-bundle-v9-ruby-2-7-{{ .Branch }}
- spree-auth-devise-bundle-v9-ruby-2-7
- run:
name: Install libvips
command: sudo apt-get install libvips
- run:
name: Set bundle path
command: bundle config --local path vendor/bundle
Expand All @@ -111,6 +120,9 @@ jobs:
keys:
- spree-auth-devise-bundle-v9-ruby-3-0-{{ .Branch }}
- spree-auth-devise-bundle-v9-ruby-3-0
- run:
name: Install libvips
command: sudo apt-get install libvips
- run:
name: Set bundle path
command: bundle config --local path vendor/bundle
Expand Down Expand Up @@ -174,4 +186,4 @@ workflows:
- bundle_ruby_3_0
- tests_mysql:
requires:
- bundle
- bundle
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
source 'https://rubygems.org'

gem 'rails-controller-testing'
gem 'devise', github: 'heartcombo/devise', branch: 'main'
gem 'spree', github: 'spree/spree', branch: 'main'
gem 'spree_backend', github: 'spree/spree_backend', branch: 'main'
gem 'spree_frontend', github: 'spree/spree_legacy_frontend', branch: 'main'
gem 'spree_backend', github: 'spree/spree_backend', branch: 'rails7'
gem 'spree_emails', github: 'spree/spree', branch: 'main'
gem 'spree_frontend', github: 'spree/spree_legacy_frontend', branch: 'main'
gem 'rspec_junit_formatter', '~> 0.4.1'

gem 'pry', '~> 0.14.1'
Expand Down
8 changes: 0 additions & 8 deletions app/models/spree/auth_configuration.rb

This file was deleted.

10 changes: 10 additions & 0 deletions lib/spree/auth/configuration.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module Spree
module Auth
class Configuration < Preferences::Configuration
preference :registration_step, :boolean, default: true
preference :signout_after_password_change, :boolean, default: true
preference :confirmable, :boolean, default: false
preference :validatable, :boolean, default: true
end
end
end
4 changes: 3 additions & 1 deletion lib/spree/auth/engine.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
require 'devise'
require 'devise-encryptable'

require_relative 'configuration'

module Spree
module Auth
class Engine < Rails::Engine
isolate_namespace Spree
engine_name 'spree_auth'

initializer "spree.auth.environment", before: :load_config_initializers do |_app|
Spree::Auth::Config = Spree::AuthConfiguration.new
Spree::Auth::Config = Spree::Auth::Configuration.new
end

initializer "spree_auth_devise.set_user_class", after: :load_config_initializers do
Expand Down