Skip to content

Commit

Permalink
Merge pull request #6438 from luisramos0/devise4
Browse files Browse the repository at this point in the history
Upgrade to devise 4.7
  • Loading branch information
luisramos0 authored Dec 8, 2020
2 parents cc00f24 + 3162cf9 commit c233052
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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'
Expand Down
16 changes: 9 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -820,6 +821,7 @@ DEPENDENCIES
stripe
test-prof
test-unit (~> 3.3)
test_after_commit
timecop
uglifier (>= 1.0.3)
unicorn
Expand Down
6 changes: 2 additions & 4 deletions app/models/spree/user.rb
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -39,9 +40,6 @@ class User < ActiveRecord::Base

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?
Expand Down

0 comments on commit c233052

Please sign in to comment.