Sha256: c7e9c30aed290691eee06cf86152a2b1099e10a56cb44713ad199904f585a034
Contents?: true
Size: 457 Bytes
Versions: 3
Compression:
Stored size: 457 Bytes
Contents
module Commontator class Subscription < ActiveRecord::Base belongs_to :subscriber, :polymorphic => true belongs_to :thread attr_accessible :subscriber, :thread validates_presence_of :subscriber, :thread validates_uniqueness_of :thread_id, :scope => [:subscriber_type, :subscriber_id] def mark_as_read update_attribute(:unread, 0) end def add_unread update_attribute(:unread, unread + 1) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
commontator-2.0.2 | app/models/commontator/subscription.rb |
commontator-2.0.1 | app/models/commontator/subscription.rb |
commontator-2.0.0 | app/models/commontator/subscription.rb |