Sha256: dbe4d162b41065ee0f878df8eeb241975f5e7b92becfa4a55277581eb2497082
Contents?: true
Size: 586 Bytes
Versions: 11
Compression:
Stored size: 586 Bytes
Contents
module Notifiable class NotificationStatus < ActiveRecord::Base belongs_to :localized_notification, :class_name => 'Notifiable::LocalizedNotification' validates :localized_notification, presence: true belongs_to :device_token, :class_name => 'Notifiable::DeviceToken' validates :device_token, presence: true self.table_name = 'notifiable_statuses' def opened! update_attribute(:status, -1) self.localized_notification.notification.increment!(:opened_count) end def opened? self.status == -1 end end end
Version data entries
11 entries across 11 versions & 1 rubygems