Also adds a second order to ensure the order to display milestones with same publication date is always the same
15 lines
506 B
Ruby
15 lines
506 B
Ruby
module BudgetExecutionsHelper
|
|
|
|
def filters_select_counts(status)
|
|
@budget.investments.winners.with_milestones.select { |i| i.milestones
|
|
.published.with_status.order_by_publication_date
|
|
.last.status_id == status rescue false }.count
|
|
end
|
|
|
|
def first_milestone_with_image(investment)
|
|
investment.milestones.order_by_publication_date
|
|
.select{ |milestone| milestone.image.present? }.last
|
|
end
|
|
|
|
end
|