summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-09-26 09:38:09 +0000
committerRémy Coutable <remy@rymai.me>2016-09-26 09:38:09 +0000
commitadf50202d773cad57f57b6fd8bb0454216fbe877 (patch)
treeb62eca449e9aa1e97ec44166935d2e2254cec42f /app
parentbb8a41b2cbfcc05f49ca15466d54220be1e20cd5 (diff)
parentd70944d911ec49bc623982655d11e6bfcadf79b8 (diff)
downloadgitlab-ce-adf50202d773cad57f57b6fd8bb0454216fbe877.tar.gz
Merge branch 'fix/import-services' into 'master'
Fixes issue with rails reserved keyword type exporting/importing services. The attribute `type`in services was being ignored by Import/Export. Added `type` as a method call in the export, as `type` gets ignored invoking `to_json`, manually adding this as a method in `import_export.yml` solves the problem. On a different note, I found assigning a title directly to `CustomIssueTrackerService` didn't play very well with `prop_accessor`: ```ruby > CustomIssueTrackerService.new(title: 'asdf') NoMethodError: undefined method `[]=' for nil:NilClass > CustomIssueTrackerService.new(title: nil) NoMethodError: undefined method `[]=' for nil:NilClass ``` This was also causing the Import/Export to failed... So I added a custom setter that fixed the problem. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/22461 See merge request !6499
Diffstat (limited to 'app')
-rw-r--r--app/models/project_services/custom_issue_tracker_service.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/project_services/custom_issue_tracker_service.rb b/app/models/project_services/custom_issue_tracker_service.rb
index 63a5ed14484..d9fba3d4a41 100644
--- a/app/models/project_services/custom_issue_tracker_service.rb
+++ b/app/models/project_services/custom_issue_tracker_service.rb
@@ -9,6 +9,10 @@ class CustomIssueTrackerService < IssueTrackerService
end
end
+ def title=(value)
+ self.properties['title'] = value if self.properties
+ end
+
def description
if self.properties && self.properties['description'].present?
self.properties['description']