Sha256: f7d32c726583006ef2f901f180093cc97b048c1f071f4fecf4843671dd837315

Contents?: true

Size: 543 Bytes

Versions: 7

Compression:

Stored size: 543 Bytes

Contents

class ReadMark < ActiveRecord::Base
  belongs_to :readable, polymorphic: true, inverse_of: :read_marks

  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

7 entries across 7 versions & 1 rubygems

Version Path
unread-0.14.0 lib/unread/read_mark.rb
unread-0.13.1 lib/unread/read_mark.rb
unread-0.13.0 lib/unread/read_mark.rb
unread-0.12.0 lib/unread/read_mark.rb
unread-0.11.0 lib/unread/read_mark.rb
unread-0.10.1 lib/unread/read_mark.rb
unread-0.10.0 lib/unread/read_mark.rb