Use newer hash style
This commit is contained in:
parent
909deaa38a
commit
c1f508b0b1
|
@ -41,9 +41,9 @@ module MilestonesHelper
|
|||
def milestone_counts(project:)
|
||||
counts = @project.milestones.reorder(nil).group(:state).count()
|
||||
{
|
||||
'opened' => counts['active'],
|
||||
'closed' => counts['closed'],
|
||||
'all' => counts['active'] + counts['closed']
|
||||
opened: counts['active'],
|
||||
closed: counts['closed'],
|
||||
all: counts['active'] + counts['closed']
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
%li{class: ("active" if params[:state].blank? || params[:state] == 'opened')}
|
||||
= link_to milestones_filter_path(state: 'opened') do
|
||||
Open
|
||||
%span.badge #{counts['opened']}
|
||||
%span.badge #{counts[:opened]}
|
||||
%li{class: ("active" if params[:state] == 'closed')}
|
||||
= link_to milestones_filter_path(state: 'closed') do
|
||||
Closed
|
||||
%span.badge #{counts['closed']}
|
||||
%span.badge #{counts[:closed]}
|
||||
%li{class: ("active" if params[:state] == 'all')}
|
||||
= link_to milestones_filter_path(state: 'all') do
|
||||
All
|
||||
%span.badge #{counts['all']}
|
||||
%span.badge #{counts[:all]}
|
||||
|
|
Loading…
Reference in New Issue