Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

TODO: one-line summary of your gem

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 mongoid_activity.gemspec
README.md

Mongoid Activity

Mongoid Activity is a simple gem to include active state to your Mongoid models.

Installation

In your Gemfile:

source 'http://rubygems.org'

gem 'mongoid_activity'

Then:

bundle install

Examples

class Task
  include Mongoid::Document
  include Mongoid::Activity

  field :description
end

After that you gain activity methods:

t = Task.create :description => "Finish mongoid_activity gem"
t.activate!
=> true
t.active?
=> true
t.deactivate!
=> true
t.inactive?
=> true
t.active?
=> false
Product.active.size
=> 0
Product.inactive.size
=> 1
Something went wrong with that request. Please try again.