bugfixes, policies, errors now have a link to the submissions

This commit is contained in:
Ralf Teusner
2015-04-10 20:23:38 +02:00
parent 4fe60d5f94
commit 172ca91329
14 changed files with 241 additions and 16 deletions

View File

@ -0,0 +1,22 @@
class CommentPolicy < ApplicationPolicy
def author?
@user == @record.author
end
private :author?
def create?
everyone
end
[:new?, :show?, :destroy?].each do |action|
define_method(action) { admin? || author? }
end
def edit?
admin?
end
def index?
everyone
end
end