No commit activity in last 3 years
No release in over 3 years
Simpler than a full state machine :)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.2.9

Runtime

>= 2.0.0.beta
 Project Readme

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