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.62 app/models/comee/core/notification.rb
comee_core-0.3.61 app/models/comee/core/notification.rb
comee_core-0.3.60 app/models/comee/core/notification.rb
comee_core-0.3.59 app/models/comee/core/notification.rb
comee_core-0.3.58 app/models/comee/core/notification.rb
comee_core-0.3.57 app/models/comee/core/notification.rb
comee_core-0.3.56 app/models/comee/core/notification.rb
comee_core-0.3.55 app/models/comee/core/notification.rb
comee_core-0.3.54 app/models/comee/core/notification.rb
comee_core-0.3.53 app/models/comee/core/notification.rb
comee_core-0.3.51 app/models/comee/core/notification.rb
comee_core-0.3.50 app/models/comee/core/notification.rb
comee_core-0.3.49 app/models/comee/core/notification.rb
comee_core-0.3.48 app/models/comee/core/notification.rb
comee_core-0.3.47 app/models/comee/core/notification.rb
comee_core-0.3.46 app/models/comee/core/notification.rb
comee_core-0.3.45 app/models/comee/core/notification.rb
comee_core-0.3.44 app/models/comee/core/notification.rb
comee_core-0.3.43 app/models/comee/core/notification.rb
comee_core-0.3.42 app/models/comee/core/notification.rb