diff options
Diffstat (limited to 'lib/gitlab/graph/json_builder.rb')
-rw-r--r-- | lib/gitlab/graph/json_builder.rb | 17 |
1 files changed, 8 insertions, 9 deletions
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 # |