dawarich/app/models/notification.rb
2024-09-05 21:01:59 +02:00

11 lines
240 B
Ruby

# frozen_string_literal: true
class Notification < ApplicationRecord
belongs_to :user
validates :title, :content, :kind, presence: true
enum :kind, { info: 0, warning: 1, error: 2 }
scope :unread, -> { where(read_at: nil) }
end