summaryrefslogtreecommitdiff
path: root/help/app/designs/ticket/by_includes_post_by.js
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2013-01-17 10:39:15 -0800
committerjessib <jessib@leap.se>2013-01-17 10:39:15 -0800
commit7d7741f7d26c3ae7ee1dc347a6b1a1142a3c2824 (patch)
tree5ec11b9600d4330ec94f56dda779634cd7dcae1b /help/app/designs/ticket/by_includes_post_by.js
parent2485527650c4832d764d318e91c10bafde8b8ae5 (diff)
parentb550cd14f33b9664fe6b547dc56107fae7d12caf (diff)
Merge branch 'master' into feature/unauthenticated_tickets
Conflicts: help/app/views/tickets/_comment.html.haml help/app/views/tickets/_new_comment.html.haml
Diffstat (limited to 'help/app/designs/ticket/by_includes_post_by.js')
-rw-r--r--help/app/designs/ticket/by_includes_post_by.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/help/app/designs/ticket/by_includes_post_by.js b/help/app/designs/ticket/by_includes_post_by.js
new file mode 100644
index 0000000..2eeac89
--- /dev/null
+++ b/help/app/designs/ticket/by_includes_post_by.js
@@ -0,0 +1,13 @@
+// TODO: This view is only used in tests--should we keep it?
+function(doc) {
+ var arr = {}
+ if (doc['type'] == 'Ticket' && doc.comments) {
+ doc.comments.forEach(function(comment){
+ if (comment.posted_by && !arr[comment.posted_by]) {
+ //don't add duplicates
+ arr[comment.posted_by] = true;
+ emit(comment.posted_by, 1);
+ }
+ });
+ }
+}