Skip to content

Commit

Permalink
Merge pull request #6162 from rubyforgood/fix-undefined-method-user-p…
Browse files Browse the repository at this point in the history
…assword-create

fix: NoMethodError users/passwords#create
  • Loading branch information
compwron authored Jan 13, 2025
2 parents a06499b + 704133c commit 2da73da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/users/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class Users::PasswordsController < Devise::PasswordsController
include SmsBodyHelper

def create
@email = params[resource_name][:email]
@phone_number = params[resource_name][:phone_number]
@email = params.dig(resource_name, :email)
@phone_number = params.dig(resource_name, :phone_number)
@resource = @email.blank? ? User.find_by(phone_number: @phone_number) : User.find_by(email: @email)

unless valid_params?(@email, @phone_number)
Expand Down

0 comments on commit 2da73da

Please sign in to comment.