class TaskRequest < ApplicationRecord
  belongs_to :project
  has_many_attached :files

  enum status: [:pending, :completed, :cancelled]

  scope :order_by_recent, -> { order(created_at: :desc) }

  validates :time_allowed, numericality: { only_integer: true, greater_than_or_equal_to: 2 }, allow_blank: true
end
