Implement unsubscribe route to delete subscriptions

This commit is contained in:
Maximilian Grundke
2017-09-13 11:57:34 +02:00
parent 0e8df9d738
commit cea2781417
5 changed files with 52 additions and 1 deletions

View File

@@ -2,4 +2,17 @@ class SubscriptionPolicy < ApplicationPolicy
def create?
everyone
end
def destroy?
author? || admin?
end
def show_error?
everyone
end
def author?
@user == @record.user
end
private :author?
end