app/models/assignment_repo/creator.rb
# Public: Add the User to the GitHub repository
# as a collaborator.
#
# Returns true if successful, otherwise raises a Result::Error
# rubocop:disable Metrics/AbcSize
Add the User to the GitHub repository
as a collaborator.

Returns true if successful, otherwise raises a Result::Error
rubocop:disable Metrics/AbcSize
Add the User to the GitHub repository as a collaborator . Returns true if successful otherwise raises a Result :: Error rubocop : disable Metrics / AbcSize
def add_user_to_repository!(github_repository_id)
      options = {}.tap { |opt| opt[:permission] = "admin" if assignment.students_are_repo_admins? }
      github_repository = GitHubRepository.new(organization.github_client, github_repository_id)
      invitation = github_repository.invite(user.github_user.login_no_cache, options)
      user.github_user.accept_repository_invitation(invitation.id) if invitation.present?
    rescue GitHub::Error
      raise Result::Error, REPOSITORY_COLLABORATOR_ADDITION_FAILED
    end
def add_user_to_repository! ( github_repository_id ) options = { } . tap { | opt | opt [ :permission ] = "admin" if assignment . students_are_repo_admins? } github_repository = GitHubRepository . new ( organization . github_client , github_repository_id ) invitation = github_repository . invite ( user . github_user . login_no_cache , options ) user . github_user . accept_repository_invitation ( invitation . id ) if invitation . present? rescue GitHub :: Error raise Result :: Error , REPOSITORY_COLLABORATOR_ADDITION_FAILED end
Public: Add the User to the GitHub repository
as a collaborator.
Public : Add the User to the GitHub repository as a collaborator .
github_repository_id
<not_specific>