Adds an entry inside moderation section that allows moderators to check
pending tasks and mark them as solved.
This commit is contained in:
Juan Salvador Pérez García
2018-06-18 11:39:04 +02:00
parent 83f78b1940
commit 33b3431c70
27 changed files with 384 additions and 9 deletions

View File

@@ -4,7 +4,14 @@ class ProposalExecutedDashboardAction < ActiveRecord::Base
belongs_to :proposal
belongs_to :proposal_dashboard_action
has_many :administrator_tasks, as: :source, dependent: :destroy
validates :proposal, presence: true, uniqueness: { scope: :proposal_dashboard_action }
validates :proposal_dashboard_action, presence: true
validates :executed_at, presence: true
validates :comments, presence: true, allow_blank: false, if: :comments_required?
def comments_required?
proposal_dashboard_action&.request_to_administrators? || false
end
end