更改:private传值问题
This commit is contained in:
parent
d6acce86a7
commit
bf7289032a
|
@ -203,8 +203,9 @@ class ProjectsController < ApplicationController
|
|||
:project_category_id, :project_language_id, :private, :identifier)
|
||||
|
||||
Projects::UpdateForm.new(validate_params.merge(user_id: @project.user_id, project_identifier: @project.identifier, project_name: @project.name)).validate!
|
||||
|
||||
private = @project.forked_from_project.present? ? !@project.forked_from_project.is_public : params[:private] || !@project.is_public
|
||||
|
||||
private = params[:private].nil? ? !@project.is_public : params[:private]
|
||||
private = @project.forked_from_project.present? ? !@project.forked_from_project.is_public : private
|
||||
|
||||
new_project_params = project_params.except(:private).merge(is_public: !private)
|
||||
@project.update_attributes!(new_project_params)
|
||||
|
|
Loading…
Reference in New Issue