module Streamit module ORM module ActiveRecord extend ActiveSupport::Concern include Streamit::Store included do belongs_to :actor, :polymorphic => true belongs_to :subject, :polymorphic => true belongs_to :receiver, :polymorphic => true default_scope order("started_at DESC") scope :ago, lambda { |num| where ["started_at > ?", Time.now - num.to_i.seconds] } scope :after, lambda { |id| where("id > #{id}") } end def save_stream! save! end end end end