Files
nairobi/app/controllers/budgets/stats_controller.rb
Javi Martín b5bc3117ac Add feature flags on budget controllers
Although we had this feature flag in most places, we forgot to add it in
some of the controllers.
2021-03-31 14:53:14 +02:00

22 lines
447 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)
@headings = @budget.headings.sort_by_name
end
private
def load_budget
@budget = Budget.find_by_slug_or_id! params[:budget_id]
end
end
end