Skip to content
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ To enable Devise's Confirmable module, which will send the user an email with a
* Add this line to an initializer in your Rails project (typically `config/initializers/spree.rb`):

```ruby
Spree::Auth::Config[:confirmable] = true
Spree::Auth::Config.confirmable = true
```

* Add a Devise initializer to your Rails project (typically `config/initializers/devise.rb`):
Expand Down
2 changes: 1 addition & 1 deletion app/models/spree/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class User < Spree::Base

devise :database_authenticatable, :registerable, :recoverable,
:rememberable, :trackable, :validatable, :encryptable
devise :confirmable if Spree::Auth::Config[:confirmable]
devise :confirmable if Spree::Auth::Config.confirmable

after_destroy :scramble_email_and_password
after_discard :scramble_email_and_password
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
post "/password/recover", to: "user_passwords#create", as: :reset_password
get "/password/change", to: "user_passwords#edit", as: :edit_password
put "/password/change", to: "user_passwords#update", as: :update_password
get "/confirm", to: "user_confirmations#show", as: :confirmation if Spree::Auth::Config[:confirmable]
get "/confirm", to: "user_confirmations#show", as: :confirmation if Spree::Auth::Config.confirmable
end

get "/checkout/registration", to: "checkout#registration", as: :checkout_registration
Expand Down
2 changes: 1 addition & 1 deletion lib/controllers/frontend/spree/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def update

if params[:user][:password].present?
# this logic needed b/c devise wants to log us out after password changes
if Spree::Auth::Config[:signout_after_password_change]
if Spree::Auth::Config.signout_after_password_change
redirect_url = spree.login_url
else
bypass_sign_in(@user)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen_string_literal: true

Devise.secret_key = '<%= SecureRandom.hex(64) %>'
Devise.email_regexp = Spree::Config[:default_email_regexp]
Devise.email_regexp = Spree::Config.default_email_regexp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def check_registration
end

def registration_required?
Spree::Auth::Config[:registration_step] &&
Spree::Auth::Config.registration_step &&
!already_registered?
end

Expand All @@ -60,7 +60,7 @@ def already_registered?

def guest_authenticated?
current_order&.email.present? &&
Spree::Config[:allow_guest_checkout]
Spree::Config.allow_guest_checkout
end

# Overrides the equivalent method defined in Spree::Core. This variation of the method will ensure that users
Expand Down
2 changes: 1 addition & 1 deletion lib/views/frontend/spree/checkout/registration.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div id="account" class="columns alpha eight">
<%= render template: 'spree/user_sessions/new' %>
</div>
<% if Spree::Config[:allow_guest_checkout] %>
<% if Spree::Config.allow_guest_checkout %>
<div id="guest_checkout" data-hook class="columns omega eight">
<h6><%= t('spree.guest_user_account') %></h6>
<% if flash[:registration_error] %>
Expand Down
Loading