fix: verify software_id before save change of a gitub repository
This commit is contained in:
parent
5d948b79bd
commit
4e62cb6593
1 changed files with 10 additions and 6 deletions
|
@ -1,16 +1,20 @@
|
|||
class GithubRepositoryController < ApplicationController
|
||||
def create
|
||||
if params[:repository][:software_id] == params[:software_id]
|
||||
@software = Software.find(params[:software_id])
|
||||
@repository = GithubRepository.new(repository_params)
|
||||
@repository.save
|
||||
end
|
||||
|
||||
redirect_to edit_software_path(@software)
|
||||
end
|
||||
|
||||
def update
|
||||
if params[:repository][:software_id] == params[:software_id]
|
||||
@software = Software.find(params[:software_id])
|
||||
@repository = GithubRepository.find(params[:id])
|
||||
@repository.update(repository_params)
|
||||
end
|
||||
|
||||
redirect_to edit_software_path(@software)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue