Add Budgets Stats Controller, route and ability on reviewing ballots and finished budget

This commit is contained in:
Bertocq
2017-06-28 23:54:05 +02:00
committed by Javi Martín
parent 63631f29a8
commit e0e02b47c0
3 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
module Budgets
class StatsController < ApplicationController
load_and_authorize_resource :budget
def show
authorize! :read_stats, @budget
@stats = load_stats
end
private
def load_stats
Budget::Stats.new(@budget).generate
end
end
end