analytics_commit_entity.rb 305 Bytes
Newer Older
1 2
# frozen_string_literal: true

James Lopez's avatar
James Lopez committed
3 4 5 6 7 8
class AnalyticsCommitEntity < CommitEntity
  include EntityDateHelper

  expose :short_id, as: :short_sha

  expose :total_time do |commit|
9
    distance_of_time_as_hash(request.total_time.to_f)
James Lopez's avatar
James Lopez committed
10 11 12 13 14 15
  end

  unexpose :author_name
  unexpose :author_email
  unexpose :message
end