Skip to content

Commit

Permalink
Fix codeclimate error
Browse files Browse the repository at this point in the history
  • Loading branch information
jayjay-w committed Jan 27, 2025
1 parent daa0a54 commit 7a9de42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def create
render_success user, 'user', 401, error
rescue ActiveRecord::RecordInvalid => e
# Check if the error is specifically related to the email being taken
if resource.errors.details[:email].any? { |error| error[:error] == :taken } && resource.errors.details.except(:email).empty?
if resource.errors.details[:email].any? { |email_error| email_error[:error] == :taken } && resource.errors.details.except(:email).empty?
# Treat as successful sign-up if only the email is taken
duplicate_user = User.get_duplicate_user(resource.email, [])[:user]
User.current = duplicate_user if duplicate_user
Expand Down

0 comments on commit 7a9de42

Please sign in to comment.