cleans common can answer ability

This commit is contained in:
Juanjo Bazán
2017-02-12 19:40:08 +01:00
parent f7c783b019
commit 909114bcf5

View File

@@ -52,8 +52,10 @@ module Abilities
can :create, DirectMessage can :create, DirectMessage
can :show, DirectMessage, sender_id: user.id can :show, DirectMessage, sender_id: user.id
can(:answer, Poll, Poll.answerable_by(user)){ |poll| poll.answerable_by?(user) } can :answer, Poll do |poll|
can(:answer, Poll::Question, Poll::Question.answerable_by(user)) do |question| poll.answerable_by?(user)
end
can :answer, Poll::Question do |question|
question.answerable_by?(user) question.answerable_by?(user)
end end
end end