summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-01-02 19:56:03 +0900
committerShinya Maeda <shinya@gitlab.com>2019-01-04 22:17:03 +0900
commitdf7ed9eef2048c9a2f79860e00a69f84fa92e10e (patch)
tree58af696ab41bf8a9649f4c60b7663ec11bd496ec /app
parent8a14548fc741e8d115d99e8303e36ed83660494d (diff)
downloadgitlab-ce-df7ed9eef2048c9a2f79860e00a69f84fa92e10e.tar.gz
Add unique constraint to release and url
Fix coding style Improve coding style Decouple UPDATE and DELETE operations of asset links Rename links_attributes to assets:links Rename exposed param and updated spec
Diffstat (limited to 'app')
-rw-r--r--app/models/releases/source.rb1
-rw-r--r--app/services/releases/create_service.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/app/models/releases/source.rb b/app/models/releases/source.rb
index 254abf86e77..4d3d54457af 100644
--- a/app/models/releases/source.rb
+++ b/app/models/releases/source.rb
@@ -3,6 +3,7 @@
module Releases
class Source
include ActiveModel::Model
+
attr_accessor :project, :tag_name, :format
FORMATS = %w(zip tar.gz tar.bz2 tar).freeze
diff --git a/app/services/releases/create_service.rb b/app/services/releases/create_service.rb
index 106fed3811d..c6e143d440d 100644
--- a/app/services/releases/create_service.rb
+++ b/app/services/releases/create_service.rb
@@ -44,7 +44,7 @@ module Releases
author: current_user,
tag: tag.name,
sha: tag.dereferenced_target.sha,
- links_attributes: params[:links_attributes] || []
+ links_attributes: params.dig(:assets, 'links') || []
)
success(tag: tag, release: release)