Skip to content

Commit

Permalink
update user class usage
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroStepaniuk committed Dec 14, 2018
1 parent b4c9691 commit 108999c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/services/api_session_recovering/reset_password_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ def restore_password
def user
return @user if @user

return unless if restore_password&.user_id.present?
return unless restore_password&.user_id.present?

if defined?("::#{ ApiSessionRecovering.configuration.users_project_entity_class_name }".constantize)
@user = "::#{ ApiSessionRecovering.configuration.users_project_entity_class_name }".
constantize.
find_by_id restore_password.user_id
user_class = "::#{ ApiSessionRecovering.configuration.users_project_entity_class_name }".constantize rescue nil

if user_class
@user = user_class.find_by_id restore_password.user_id

return @user
end
Expand Down

0 comments on commit 108999c

Please sign in to comment.