1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/app/models/notification_preference.rb

14 lines
357 B
Ruby

# frozen_string_literal: true
# Allow user to set their preferences for notifications (push and email)
class NotificationPreference < ApplicationRecord
belongs_to :user
belongs_to :notification_type
validates :notification_type_id, uniqueness: { scope: :user }
def notification_type
NotificationType.find(notification_type_id).name
end
end