Files
nairobi/app/helpers/budget_executions_helper.rb
Javi Martín f9ed186909 Add rubocop spacing rules
We were following these rules in most places; we just didn't define them
anywhere.
2019-09-10 21:04:56 +02:00

19 lines
498 B
Ruby

module BudgetExecutionsHelper
def filters_select_counts(status)
@budget.investments.winners.with_milestone_status_id(status).count
end
def options_for_milestone_tags
@budget.milestone_tags.map do |tag|
["#{tag} (#{@budget.investments.winners.tagged_with(tag).count})", tag]
end
end
def first_milestone_with_image(investment)
investment.milestones.order_by_publication_date
.select { |milestone| milestone.image.present? }.last
end
end