Sha256: d3ffb88a5194290e5c265ed5a1f343307fb575182a4762295fd24df73d8e68d0

Contents?: true

Size: 395 Bytes

Versions: 16

Compression:

Stored size: 395 Bytes

Contents

module Comee
  module Core
    class Notification < ApplicationRecord
      include Noticed::Model

      belongs_to :recipient, polymorphic: true

      def message
        {id: id, read: !read_at.nil?, created_at: created_at}.merge(to_notification.message)
      end

      def self.messages(notifications)
        notifications.includes(:recipient).map(&:message)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
comee_core-0.1.25 app/models/comee/core/notification.rb
comee_core-0.1.24 app/models/comee/core/notification.rb
comee_core-0.1.23 app/models/comee/core/notification.rb
comee_core-0.1.22 app/models/comee/core/notification.rb
comee_core-0.1.21 app/models/comee/core/notification.rb
comee_core-0.1.20 app/models/comee/core/notification.rb
comee_core-0.1.19 app/models/comee/core/notification.rb
comee_core-0.1.18 app/models/comee/core/notification.rb
comee_core-0.1.17 app/models/comee/core/notification.rb
comee_core-0.1.16 app/models/comee/core/notification.rb
comee_core-0.1.15 app/models/comee/core/notification.rb
comee_core-0.1.14 app/models/comee/core/notification.rb
comee_core-0.1.13 app/models/comee/core/notification.rb
comee_core-0.1.12 app/models/comee/core/notification.rb
comee_core-0.1.11 app/models/comee/core/notification.rb
comee_core-0.1.10 app/models/comee/core/notification.rb