dawarich/app/models/notification.rb

12 lines
239 B
Ruby
Raw Normal View History

2024-07-04 16:20:12 -04:00
# 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