removes before_action in favor of cancancan

This commit is contained in:
Juanjo Bazán
2016-01-13 12:56:27 +01:00
parent e5caf84c02
commit eb4c352f7d
2 changed files with 3 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
class Admin::SpendingProposalsController < Admin::BaseController
has_filters %w{unresolved accepted rejected}, only: :index
before_action :load_spending_proposal, except: [:index, :show]
load_and_authorize_resource except: [:index, :show]
def index
@spending_proposals = SpendingProposal.includes([:geozone]).send(@current_filter).order(created_at: :desc).page(params[:page])
@@ -21,10 +21,4 @@ class Admin::SpendingProposalsController < Admin::BaseController
redirect_to request.query_parameters.merge(action: :index)
end
private
def load_spending_proposal
@spending_proposal = SpendingProposal.find(params[:id])
end
end

View File

@@ -34,6 +34,8 @@ module Abilities
can [:search, :create, :index, :destroy], ::Moderator
can :manage, Annotation
can :manage, SpendingProposal
end
end
end