app/models/wupee/notification.rb in wupee-1.0.1 vs app/models/wupee/notification.rb in wupee-1.0.2
- old
+ new
@@ -4,9 +4,12 @@
belongs_to :notification_type, class_name: "Wupee::NotificationType"
validates_presence_of :receiver,
:notification_type
+ scope :unread, -> { where(is_read: false) }
+ scope :ordered, -> { order(created_at: :desc) }
+
def mark_as_read
update_columns(is_read: true)
end
def mark_as_sent