Files
nairobi/app/models/administrator_task.rb
Javi Martín c43b0fea64 Use Rails 5 conventions in Dashboard
These models and migrations were added on a branch based on Rails 4.
2019-04-29 13:08:43 -05:00

12 lines
289 B
Ruby

class AdministratorTask < ApplicationRecord
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