diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-06-27 10:20:11 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-06-27 10:20:11 +0300 |
commit | 01960fce252433986d1bcd19c4fee0380921dfdb (patch) | |
tree | 0f7c12b0fa938f4217d4e899f9d23068a12ed72e /lib/api/variables.rb | |
parent | ad3843aee14abb36e0f4a7ede7210f26ed4879c9 (diff) |
Fix optional args for POST :id/variables
Always use declared_params(include_missing: false)
so that we don't give nils for optional arguments
Diffstat (limited to 'lib/api/variables.rb')
-rw-r--r-- | lib/api/variables.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/variables.rb b/lib/api/variables.rb index 381c4ef50b0..10374995497 100644 --- a/lib/api/variables.rb +++ b/lib/api/variables.rb @@ -45,7 +45,7 @@ module API optional :protected, type: String, desc: 'Whether the variable is protected' end post ':id/variables' do - variable = user_project.variables.create(declared(params, include_parent_namespaces: false).to_h) + variable = user_project.variables.create(declared_params(include_missing: false)) if variable.valid? present variable, with: Entities::Variable |