diff --git a/lib/use_case/relationship/create.rb b/lib/use_case/relationship/create.rb index 61d7cbcf..54f61f39 100644 --- a/lib/use_case/relationship/create.rb +++ b/lib/use_case/relationship/create.rb @@ -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 diff --git a/lib/use_case/relationship/destroy.rb b/lib/use_case/relationship/destroy.rb index 0b0fcf54..3788f38c 100644 --- a/lib/use_case/relationship/destroy.rb +++ b/lib/use_case/relationship/destroy.rb @@ -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