Sha256: 6b0ad7702f9a3aef2d188673aa4378b7ad4c7b1235608a1018fa8e28e346fcbe
Contents?: true
Size: 473 Bytes
Versions: 11
Compression:
Stored size: 473 Bytes
Contents
module Commontator class Subscription < ActiveRecord::Base belongs_to :subscriber, :polymorphic => true belongs_to :thread validates_presence_of :subscriber, :thread validates_uniqueness_of :thread_id, :scope => [:subscriber_id, :subscriber_type] attr_accessible :subscriber, :thread def mark_as_read self.update_attribute(:unread, 0) end def add_unread self.update_attribute(:unread, unread + 1) end end end
Version data entries
11 entries across 11 versions & 1 rubygems