Sha256: 366bf56705f0450189f15cd0f1e0103f147c82424c0ce11f5b92367bdcb55e62

Contents?: true

Size: 524 Bytes

Versions: 8

Compression:

Stored size: 524 Bytes

Contents

class ReadMark < ActiveRecord::Base
  belongs_to :readable, :polymorphic => true

  validates_presence_of :reader_id, :reader_type, :readable_type

  scope :global, lambda { where(:readable_id => nil) }
  scope :single, lambda { where('readable_id IS NOT NULL') }
  scope :older_than, lambda { |timestamp| where([ 'timestamp < ?', timestamp ]) }

  # Returns the classes defined by acts_as_reader
  class_attribute :reader_classes

  # Returns the classes defined by acts_as_readable
  class_attribute :readable_classes
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
unread-0.9.1 lib/unread/read_mark.rb
unread-0.9.0 lib/unread/read_mark.rb
unread-0.8.3 lib/unread/read_mark.rb
unread-0.8.2 lib/unread/read_mark.rb
unread-0.8.1 lib/unread/read_mark.rb
unread-0.8.0 lib/unread/read_mark.rb
unread-0.7.1 lib/unread/read_mark.rb
unread-0.7.0 lib/unread/read_mark.rb