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:
13
app/models/administrator_task.rb
Normal file
13
app/models/administrator_task.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AdministratorTask < ActiveRecord::Base
|
||||
belongs_to :source, polymorphic: true
|
||||
belongs_to :user
|
||||
|
||||
validates :source, presence: true
|
||||
|
||||
default_scope { order(created_at: :asc) }
|
||||
|
||||
scope :pending, -> { where(executed_at: nil) }
|
||||
scope :done, -> { where.not(executed_at: nil) }
|
||||
end
|
||||
Reference in New Issue
Block a user