Sha256: 5b32fd001832c18de898a4129e464e2d488c742a33794606bb02bb90cddf3694

Contents?: true

Size: 374 Bytes

Versions: 234

Compression:

Stored size: 374 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.map(&:message)
      end
    end
  end
end

Version data entries

234 entries across 234 versions & 1 rubygems

Version Path
comee_core-0.3.41 app/models/comee/core/notification.rb
comee_core-0.3.40 app/models/comee/core/notification.rb
comee_core-0.3.39 app/models/comee/core/notification.rb
comee_core-0.3.38 app/models/comee/core/notification.rb
comee_core-0.3.37 app/models/comee/core/notification.rb
comee_core-0.3.36 app/models/comee/core/notification.rb
comee_core-0.3.35 app/models/comee/core/notification.rb
comee_core-0.3.34 app/models/comee/core/notification.rb
comee_core-0.3.33 app/models/comee/core/notification.rb
comee_core-0.3.32 app/models/comee/core/notification.rb
comee_core-0.3.31 app/models/comee/core/notification.rb
comee_core-0.3.30 app/models/comee/core/notification.rb
comee_core-0.3.29 app/models/comee/core/notification.rb
comee_core-0.3.28 app/models/comee/core/notification.rb
comee_core-0.3.27 app/models/comee/core/notification.rb
comee_core-0.3.26 app/models/comee/core/notification.rb
comee_core-0.3.25 app/models/comee/core/notification.rb
comee_core-0.3.24 app/models/comee/core/notification.rb
comee_core-0.3.23 app/models/comee/core/notification.rb
comee_core-0.3.22 app/models/comee/core/notification.rb