mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update payments_controller.rb
This commit is contained in:
@@ -12,7 +12,7 @@ class PaymentsController < ApplicationController
|
|||||||
|
|
||||||
include AuthHelper
|
include AuthHelper
|
||||||
|
|
||||||
before_filter :find_project, User.current.allowed_to?(:add_paypments, @project)
|
before_filter :check_permissions
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@payment = Payment.new
|
@payment = Payment.new
|
||||||
@@ -32,14 +32,13 @@ class PaymentsController < ApplicationController
|
|||||||
else
|
else
|
||||||
flash[:error] = @payment.errors.full_messages.to_sentence
|
flash[:error] = @payment.errors.full_messages.to_sentence
|
||||||
redirect_to new_customer_path
|
redirect_to new_customer_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def find_project
|
def check_permissions
|
||||||
# @project variable must be set before calling the authorize filter
|
return User.current.allowed_to?(:add_paypments, Project.find(params[:project_id]))
|
||||||
@project = Project.find(params[:project_id])
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def only_one_non_zero?( array )
|
def only_one_non_zero?( array )
|
||||||
|
|||||||
Reference in New Issue
Block a user