Sha256: 3a8515d7833847cc24d01c920fe15c7e379c93f0589a4cb39b9d4dfb147d99e7
Contents?: true
Size: 749 Bytes
Versions: 1
Compression:
Stored size: 749 Bytes
Contents
# MongoidToggle [![Build Status](https://secure.travis-ci.org/Langwhich/mongoid_toggle.png)](https://secure.travis-ci.org/Langwhich/mongoid_toggle) MongoidToggle adds a simple function to mongoid documents to toggle boolean values with optional save for the record. ## Install ```ruby gem 'mongoid_toggle' ``` ## Usage ```ruby class Person include Mongoid::Document include Mongoid::Toggle field :name, :type => String field :is_active, :type => Boolean end ``` ```ruby p = Person.first # This call toggles is_active and saves the record p.toggle! :is_active # This call toggles is_active without saving the record p.toggle :is_active ``` ## Credits Copyright (c) 2012 Langwhich GmbH <http://www.langwhich.com>
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mongoid_toggle-0.1.1 | README.md |