Implement index action. Repair destroy

This commit is contained in:
Maximilian Grundke
2017-10-15 18:23:58 +02:00
parent e52c9213a1
commit d353dbaf5b
5 changed files with 52 additions and 20 deletions

View File

@@ -1,8 +1,4 @@
class UserExerciseFeedbackPolicy < ApplicationPolicy
def author?
@user == @record.author
end
private :author?
class UserExerciseFeedbackPolicy < AdminOrAuthorPolicy
def create?
everyone
@@ -12,8 +8,4 @@ class UserExerciseFeedbackPolicy < ApplicationPolicy
everyone
end
[:show? ,:destroy?, :edit?, :update?].each do |action|
define_method(action) { admin? || author?}
end
end