Fix reset of tasks

This commit is contained in:
Jan Renz
2015-04-20 22:30:31 +02:00
parent 30985a249e
commit 9c8d0b01eb
7 changed files with 24 additions and 15 deletions

View File

@ -12,12 +12,12 @@ class ExercisePolicy < AdminOrAuthorPolicy
define_method(action) { admin? || author? || team_member? }
end
[:implement?, :submit?].each do |action|
[:implement?, :submit?, :reload?].each do |action|
define_method(action) { everyone }
end
def team_member?
@record.team.try(:members, []).include?(@user)
@record.team.try(:members, []).include?(@user) if @record.team
end
private :team_member?