app/models/commontator/subscription.rb~ in commontator-2.0.1 vs app/models/commontator/subscription.rb~ in commontator-2.0.2
- old
+ new
@@ -2,20 +2,17 @@
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
- self.update_attribute(:unread, 0)
+ update_attribute(:unread, 0)
end
def add_unread
- self.update_attribute(:unread, unread + 1)
+ update_attribute(:unread, unread + 1)
end
end
end