Update payments_controller.rb

This commit is contained in:
2017-03-23 04:52:19 -04:00
committed by GitHub
parent 863437b1b7
commit bef9774c4e

View File

@@ -12,7 +12,7 @@ class PaymentsController < ApplicationController
include AuthHelper
before_filter :add_payments, :authorize
before_filter :find_project, :authorize
def new
@payment = Payment.new
@@ -36,6 +36,11 @@ end
end
private
def find_project
# @project variable must be set before calling the authorize filter
@project = Project.find(params[:project_id])
end
def only_one_non_zero?( array )
found_non_zero = false