Skip to content

Commit

Permalink
fix: redirection to onboarding disabled on devise controllers and onb…
Browse files Browse the repository at this point in the history
…oarded?
  • Loading branch information
kjellberg committed Mar 25, 2024
1 parent 4ed9d2b commit 2e47864
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/concerns/accounts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Accounts

included do
helper_method :current_account, :personal_account, :onboarded?
before_action :redirect_to_onboarding
before_action :redirect_to_onboarding, unless: :devise_controller?
end

def current_account
Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ class User < ApplicationRecord
validates_associated :personal_account

def onboarded?
personal_account.present?
personal_account.present? && personal_account.persisted?
end
end

0 comments on commit 2e47864

Please sign in to comment.