This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Notification < ActiveRecord::Base | |
| serialize :device_ids # weak reference to devices | |
| validates_presence_of :message | |
| default_scope order("created_at DESC") | |
| scope :ready, where("ready == ?", true) | |
| scope :sent, where("sent_at IS NOT NULL") | |
| scope :not_sent, where("sent_at IS NULL") | |
| scope :sendable, not_sent.ready | |
| scope :old, lambda{ where("updated_at < ?", 10.days.ago) } |
NewerOlder