diff options
author | Jasper Maes <jaspermaes.jm@gmail.com> | 2018-09-08 11:30:15 +0200 |
---|---|---|
committer | Jasper Maes <jaspermaes.jm@gmail.com> | 2018-09-11 08:18:27 +0200 |
commit | 459fdb1f6f71d7296245e7017b7c79cb53ba53d2 (patch) | |
tree | 97b7f2bd3d43636288d2a17061af0bc96059b118 | |
parent | 282db545a17d6cd44c92581e206fce89774db691 (diff) | |
download | gitlab-ce-459fdb1f6f71d7296245e7017b7c79cb53ba53d2.tar.gz |
Rails 5: fix issue move service
In rails 5, the attributes method for an enum returns the name
instead of the database integer.
-rw-r--r-- | app/services/issues/move_service.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/rails5-fix-issue-move-service.yml | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/app/services/issues/move_service.rb b/app/services/issues/move_service.rb index c52aa577dd8..ec9d8944e4e 100644 --- a/app/services/issues/move_service.rb +++ b/app/services/issues/move_service.rb @@ -102,7 +102,7 @@ module Issues events = batch.map do |event| event.attributes .except('id', 'reference', 'reference_html') - .merge('issue_id' => @new_issue.id, 'created_at' => event.created_at) + .merge('issue_id' => @new_issue.id, 'action' => ResourceLabelEvent.actions[event.action]) end Gitlab::Database.bulk_insert(ResourceLabelEvent.table_name, events) diff --git a/changelogs/unreleased/rails5-fix-issue-move-service.yml b/changelogs/unreleased/rails5-fix-issue-move-service.yml new file mode 100644 index 00000000000..1e71544e587 --- /dev/null +++ b/changelogs/unreleased/rails5-fix-issue-move-service.yml @@ -0,0 +1,6 @@ +--- +title: 'Rails 5: fix issue move service In rails 5, the attributes method for an enum + returns the name instead of the database integer.' +merge_request: 21616 +author: Jasper Maes +type: other |