Class: API::Entities::IssuableTimeStats
- Inherits:
-
Grape::Entity
- Object
- Grape::Entity
- API::Entities::IssuableTimeStats
- Defined in:
- lib/api/entities/issuable_time_stats.rb
Instance Method Summary collapse
-
#total_time_spent ⇒ Object
rubocop: disable CodeReuse/ActiveRecord.
Instance Method Details
#total_time_spent ⇒ Object
rubocop: disable CodeReuse/ActiveRecord
19 20 21 22 |
# File 'lib/api/entities/issuable_time_stats.rb', line 19 def total_time_spent # Avoids an N+1 query since timelogs are preloaded object.timelogs.sum(&:time_spent) end |