Sha256: ee77934d5872176d76b68649ceda493352918a514a1420fa5d8d40f1902091e9

Contents?: true

Size: 543 Bytes

Versions: 3

Compression:

Stored size: 543 Bytes

Contents

module Streamit
  module ORM
    module MongoMapper
      extend  ActiveSupport::Concern
      include Streamit::Store
      
      included do
        key :stream_type, String
        key :started_at, Time

        belongs_to :actor,    :polymorphic => true
        belongs_to :subject,  :polymorphic => true
        belongs_to :receiver, :polymorphic => true
        
        scope :ago,   lambda { |num| where(:started_at.gt => Time.now - num.to_i.seconds) }
      end
      
      def save_stream!
        save!
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
streamit-0.0.6.2 lib/streamit/orm/mongo_mapper.rb
streamit-0.0.6.1 lib/streamit/orm/mongo_mapper.rb
streamit-0.0.6 lib/streamit/orm/mongo_mapper.rb