Files
grecia/app/controllers/budgets/stats_controller.rb
Javi Martín d18c627392 Add and apply Layout/EmptyLinesAfterModuleInclusion rule
This rule was added in rubocop 1.79. We were inconsistent about it, so
we're adding it to get more consistency.
2025-11-05 14:27:12 +01:00

23 lines
464 B
Ruby

module Budgets
class StatsController < ApplicationController
include FeatureFlags
feature_flag :budgets
before_action :load_budget
authorize_resource :budget
def show
authorize! :read_stats, @budget
@stats = Budget::Stats.new(@budget).tap(&:generate)
@headings = @budget.headings.sort_by_name
end
private
def load_budget
@budget = Budget.find_by_slug_or_id! params[:budget_id]
end
end
end