fix bug
This commit is contained in:
parent
0d00fd1744
commit
78a1d48a3e
|
@ -15,7 +15,7 @@ class Organizations::ClasController < Organizations::BaseController
|
||||||
return tip_exception("组织已存在CLA!")
|
return tip_exception("组织已存在CLA!")
|
||||||
else
|
else
|
||||||
Organizations::CreateClaForm.new(cla_params).validate!
|
Organizations::CreateClaForm.new(cla_params).validate!
|
||||||
@cla = Cla.build(cla_params)
|
@cla = Cla.build(cla_params,@organization.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
|
@ -57,7 +57,7 @@ class Organizations::ClasController < Organizations::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_cla
|
def load_cla
|
||||||
@cla = Cla.find_by!(organization:params[:organization_id], key: params[:id])
|
@cla = Cla.find_by!(organization:@organization, key: params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -27,8 +27,8 @@ class Cla < ApplicationRecord
|
||||||
self.key.parameterize
|
self.key.parameterize
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.build(params)
|
def self.build(params,org_id)
|
||||||
self.create!(organization_id: params[:organization_id],
|
self.create!(organization_id: org_id,
|
||||||
name: params[:name],
|
name: params[:name],
|
||||||
key: params[:key],
|
key: params[:key],
|
||||||
content: params[:content],
|
content: params[:content],
|
||||||
|
|
Loading…
Reference in New Issue