1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +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