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
|
def find_source_user
|
||||||
user_id = @current_user_id
|
user_id = @current_user_id
|
||||||
User.find(user_id)
|
::User.find(user_id)
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
raise Errors::UserNotFound
|
raise Errors::UserNotFound
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_target_user
|
def find_target_user
|
||||||
target_user = @target_user
|
target_user = @target_user
|
||||||
return target_user if target_user.is_a?(User)
|
return target_user if target_user.is_a?(::User)
|
||||||
User.find_by!(screen_name: target_user)
|
::User.find_by!(screen_name: target_user)
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
raise Errors::UserNotFound
|
raise Errors::UserNotFound
|
||||||
end
|
end
|
||||||
|
|
|
@ -37,15 +37,15 @@ module UseCase
|
||||||
|
|
||||||
def find_source_user
|
def find_source_user
|
||||||
user_id = @current_user_id
|
user_id = @current_user_id
|
||||||
User.find(user_id)
|
::User.find(user_id)
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
raise Errors::UserNotFound
|
raise Errors::UserNotFound
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_target_user
|
def find_target_user
|
||||||
target_user = @target_user
|
target_user = @target_user
|
||||||
return target_user if target_user.is_a?(User)
|
return target_user if target_user.is_a?(::User)
|
||||||
User.find_by!(screen_name: target_user)
|
::User.find_by!(screen_name: target_user)
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
raise Errors::UserNotFound
|
raise Errors::UserNotFound
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue