Fix namespace resolution in relationship use cases
This commit is contained in:
parent
ce57414595
commit
c8059ccd6b
|
@ -37,15 +37,15 @@ module UseCase
|
|||
|
||||
def find_source_user
|
||||
user_id = @current_user_id
|
||||
User.find(user_id)
|
||||
::User.find(user_id)
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
raise Errors::UserNotFound
|
||||
end
|
||||
|
||||
def find_target_user
|
||||
target_user = @target_user
|
||||
return target_user if target_user.is_a?(User)
|
||||
User.find_by!(screen_name: target_user)
|
||||
return target_user if target_user.is_a?(::User)
|
||||
::User.find_by!(screen_name: target_user)
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
raise Errors::UserNotFound
|
||||
end
|
||||
|
|
|
@ -37,15 +37,15 @@ module UseCase
|
|||
|
||||
def find_source_user
|
||||
user_id = @current_user_id
|
||||
User.find(user_id)
|
||||
::User.find(user_id)
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
raise Errors::UserNotFound
|
||||
end
|
||||
|
||||
def find_target_user
|
||||
target_user = @target_user
|
||||
return target_user if target_user.is_a?(User)
|
||||
User.find_by!(screen_name: target_user)
|
||||
return target_user if target_user.is_a?(::User)
|
||||
::User.find_by!(screen_name: target_user)
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
raise Errors::UserNotFound
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue