Merge pull request #6438 from luisramos0/devise4

Upgrade to devise 4.7
This commit is contained in:
Luis Ramos
2020-12-08 17:19:13 +00:00
committed by GitHub
3 changed files with 14 additions and 13 deletions

View File

@@ -45,9 +45,9 @@ gem 'stripe'
# which is needed for Pin Payments (and possibly others).
gem 'activemerchant', '~> 1.78.0'
gem 'devise', '~> 3.5.10' # v4.0.0 needs rails 4.1
gem 'devise'
gem 'devise-encryptable'
gem 'devise-token_authenticatable', '~> 0.4.10' # v0.5.0 needs devise v4
gem 'devise-token_authenticatable'
gem 'jwt', '~> 2.2'
gem 'oauth2', '~> 1.4.4' # Used for Stripe Connect
@@ -146,6 +146,7 @@ end
group :test do
gem 'simplecov', require: false
gem 'test-prof'
gem 'test_after_commit' # needed to test Devise callbacks
gem 'webmock'
# See spec/spec_helper.rb for instructions
# gem 'perftools.rb'

View File

@@ -196,17 +196,16 @@ GEM
delayed_job (> 2.0.3)
rack-protection (>= 1.5.5)
sinatra (>= 1.4.4)
devise (3.5.10)
devise (4.7.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
railties (>= 4.1.0)
responders
thread_safe (~> 0.1)
warden (~> 1.2.3)
devise-encryptable (0.2.0)
devise (>= 2.1.0)
devise-token_authenticatable (0.4.10)
devise (>= 3.5.2, < 4.0.0)
devise-token_authenticatable (1.1.0)
devise (>= 4.0.0, < 5.0.0)
diff-lcs (1.4.4)
docile (1.3.2)
domain_name (0.5.20190701)
@@ -672,6 +671,8 @@ GEM
test-prof (0.7.5)
test-unit (3.3.7)
power_assert
test_after_commit (1.2.2)
activerecord (>= 3.2, < 5.0)
thor (0.20.3)
thread_safe (0.3.6)
tilt (1.4.1)
@@ -750,9 +751,9 @@ DEPENDENCIES
debugger-linecache
delayed_job_active_record
delayed_job_web
devise (~> 3.5.10)
devise
devise-encryptable
devise-token_authenticatable (~> 0.4.10)
devise-token_authenticatable
dfc_provider!
eventmachine (>= 1.2.3)
factory_bot_rails (= 4.10.0)
@@ -820,6 +821,7 @@ DEPENDENCIES
stripe
test-prof
test-unit (~> 3.3)
test_after_commit
timecop
uglifier (>= 1.0.3)
unicorn

View File

@@ -1,7 +1,8 @@
module Spree
class User < ActiveRecord::Base
devise :database_authenticatable, :token_authenticatable, :registerable, :recoverable,
:rememberable, :trackable, :validatable, :encryptable, encryptor: 'authlogic_sha512'
:rememberable, :trackable, :validatable,
:encryptable, :confirmable, encryptor: 'authlogic_sha512', reconfirmable: true
has_many :orders
belongs_to :ship_address, foreign_key: 'ship_address_id', class_name: 'Spree::Address'
@@ -39,9 +40,6 @@ module Spree
validate :limit_owned_enterprises
# We use the same options as Spree and add :confirmable
devise :confirmable, reconfirmable: true
class DestroyWithOrdersError < StandardError; end
def self.admin_created?