summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-12-21 13:07:47 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-12-21 13:07:47 +0200
commit4398bdf2c953bf159cef1b8e34c5ec44f582b814 (patch)
tree5c7f8a1b9600f663e4f41a391d44a189293e6322 /lib
parenta567d596f85b2f2f23e8e6f31f0eb3fa957f2c48 (diff)
parenta47032bc29e3efe3894648e02b7c24b8bf07f46e (diff)
downloadgitlab-ce-4398bdf2c953bf159cef1b8e34c5ec44f582b814.tar.gz
Merge branch 'koenpunt-gh-issue-1509'
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/graph/commit.rb2
-rw-r--r--lib/gitlab/graph/json_builder.rb17
2 files changed, 9 insertions, 10 deletions
diff --git a/lib/gitlab/graph/commit.rb b/lib/gitlab/graph/commit.rb
index af8d7828ce9..3d82c34432f 100644
--- a/lib/gitlab/graph/commit.rb
+++ b/lib/gitlab/graph/commit.rb
@@ -28,7 +28,7 @@ module Gitlab
h[:refs] = refs.collect{|r|r.name}.join(" ") unless refs.nil?
h[:id] = sha
h[:date] = date
- h[:message] = escape_once(message)
+ h[:message] = message
h[:login] = author.email
h
end
diff --git a/lib/gitlab/graph/json_builder.rb b/lib/gitlab/graph/json_builder.rb
index c2c3fa662a6..a5914363393 100644
--- a/lib/gitlab/graph/json_builder.rb
+++ b/lib/gitlab/graph/json_builder.rb
@@ -17,16 +17,15 @@ module Gitlab
@commits = collect_commits
@days = index_commits
end
-
- def days_json
- @days_json = @days.compact.map { |d| [d.day, d.strftime("%b")] }.to_json
- end
-
- def commits_json
- @commits_json = @commits.map(&:to_graph_hash).to_json
+
+ def to_json(*args)
+ {
+ days: @days.compact.map { |d| [d.day, d.strftime("%b")] },
+ commits: @commits.map(&:to_graph_hash)
+ }.to_json(*args)
end
-
- protected
+
+ protected
# Get commits from repository
#