Sha256: e0e5ae66b0888127fe388a88043598694cf33f3c9cdbdce8da05e93f21a5bc02
Contents?: true
Size: 493 Bytes
Versions: 16
Compression:
Stored size: 493 Bytes
Contents
module Carnival class AdminUserNotification < ActiveRecord::Base include ActionView::Helpers::UrlHelper belongs_to :admin_user belongs_to :notification scope :unread, -> {where('read = ?', false)} def message_link link_to(self.notification.message, Rails.application.routes.url_helpers.admin_read_admin_user_notification_path(self)) end def mark_as_read_and_get_link self.read = true self.save self.notification.link end end end
Version data entries
16 entries across 16 versions & 1 rubygems