user upgrades: add links to Stripe payment & receipt page.
Add links to the Stripe payment page and the Stripe receipt page on completed user upgrades. The Stripe payment link is a link to the payment details on the Stripe dashboard and is only visible to the owner.
This commit is contained in:
@@ -10,4 +10,12 @@ class UserUpgradePolicy < ApplicationPolicy
|
||||
def show?
|
||||
record.recipient == user || record.purchaser == user || user.is_owner?
|
||||
end
|
||||
|
||||
def receipt?
|
||||
(record.purchaser == user || user.is_owner?) && record.has_receipt?
|
||||
end
|
||||
|
||||
def payment?
|
||||
user.is_owner? && record.has_payment?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user