diff --git a/app/controllers/github_repository_controller.rb b/app/controllers/github_repository_controller.rb index 1741b4f..ef78c7b 100644 --- a/app/controllers/github_repository_controller.rb +++ b/app/controllers/github_repository_controller.rb @@ -1,8 +1,11 @@ class GithubRepositoryController < ApplicationController def create @software = Software.find(params[:software_id]) - @repository = GithubRepository.new(params.permit(:name, :software_id)) - @repository.save + + if @software.id == params[:repository][:software_id].to_i + @repository = GithubRepository.new(params.require(:repository).permit(:software_id, :name)) + @repository.save + end redirect_to edit_software_path(@software) end