Implements #150
Adds an entry inside moderation section that allows moderators to check pending tasks and mark them as solved.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user