summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-03-01 09:59:15 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-03-01 09:59:15 +0000
commit11dd2348c410949c98adfc10cdcf5be787742179 (patch)
tree60a0f6417228e80a1b28384f0a9c7998a9d95d75 /lib
parente7fb3942664d12f517ec62f84f2119d8dee6bffa (diff)
parent54c1dc675f4eba7083373149222cd6b7b9292d1b (diff)
downloadgitlab-ce-11dd2348c410949c98adfc10cdcf5be787742179.tar.gz
Merge branch '22951-fix-todos-api-endpoint-error-for-commits' into 'master'
Fix todos API endpoint application error Closes #22951 See merge request !9351
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index a99d9cadc8a..b839d72a0e1 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -394,7 +394,8 @@ module API
expose :target_type
expose :target do |todo, options|
- Entities.const_get(todo.target_type).represent(todo.target, options)
+ target = todo.target_type == 'Commit' ? 'RepoCommit' : todo.target_type
+ Entities.const_get(target).represent(todo.target, options)
end
expose :target_url do |todo, options|