Class: Milestones::ClosedIssuesCountService

Inherits:
BaseCountService show all
Defined in:
app/services/milestones/closed_issues_count_service.rb

Instance Method Summary collapse

Methods inherited from BaseCountService

#cache_options, #count, #count_stored?, #delete_cache, #raw?, #refresh_cache, #uncached_count, #update_cache_for_key

Constructor Details

#initialize(milestone) ⇒ ClosedIssuesCountService

Returns a new instance of ClosedIssuesCountService.


5
6
7
# File 'app/services/milestones/closed_issues_count_service.rb', line 5

def initialize(milestone)
  @milestone = milestone
end

Instance Method Details

#cache_keyObject


9
10
11
# File 'app/services/milestones/closed_issues_count_service.rb', line 9

def cache_key
  "milestone_closed_issues_count_#{@milestone.milestoneish_id}"
end

#relation_for_countObject


13
14
15
# File 'app/services/milestones/closed_issues_count_service.rb', line 13

def relation_for_count
  @milestone.issues.closed
end