Add Budgets Stats Controller, route and ability on reviewing ballots and finished budget
This commit is contained in:
18
app/controllers/budgets/stats_controller.rb
Normal file
18
app/controllers/budgets/stats_controller.rb
Normal 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
|
||||
Reference in New Issue
Block a user