Actualizar plugin Questions a 1.0.2 light

This commit is contained in:
Manuel Cillero 2020-11-22 21:40:10 +01:00
parent b9e569d03f
commit b37d1305f1
64 changed files with 394 additions and 229 deletions

View file

@ -1,7 +1,7 @@
# This file is a part of Redmine Q&A (redmine_questions) plugin,
# Q&A plugin for Redmine
#
# Copyright (C) 2011-2018 RedmineUP
# Copyright (C) 2011-2020 RedmineUP
# http://www.redmineup.com/
#
# redmine_questions is free software: you can redistribute it and/or modify
@ -97,6 +97,7 @@ class QuestionsAnswer < ActiveRecord::Base
end
def editable_by?(user)
(author == user && user.allowed_to?(:edit_own_answers, project)) ||
user.allowed_to?(:edit_questions, project)
end
@ -107,7 +108,7 @@ class QuestionsAnswer < ActiveRecord::Base
def votable_by?(user)
user.allowed_to?(:vote_questions, project)
end
private
def check_accepted
question.answers.update_all(:accepted => false) if question &&
@ -121,6 +122,6 @@ class QuestionsAnswer < ActiveRecord::Base
end
def send_notification
Mailer.question_answer_added(self).deliver if Setting.notified_events.include?('question_answer_added')
Mailer.question_answer_added(User.current, self).deliver if Setting.notified_events.include?('question_answer_added')
end
end