0.0
No commit activity in last 3 years
No release in over 3 years
MongoMapper plugin that prevents any fields responding to empty? from being persisted if empty
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.5.0
>= 2.7

Runtime

>= 0.10.1
 Project Readme

mm_no_empties

Models that use this plugin do not persist empty Arrays, Hashes or Sets. Nil values are also excluded as per standard MM behaviour.

Requirements

  • Ruby 1.9
  • MongoMapper 0.10.1 or greater

Installation

Add this to your Gemfile if using Bundler: gem 'mm_no_empties'

Or install the gem from the command line: gem install mm_no_empties

Usage

Use the MongoMapper plugin method to add MmNoEmpties to your model, for example:

class Group
  include MongoMapper::Document
  plugin  MmNoEmpties
  
  many :people, :class_name => 'Person'
  
  key  :names,  Array
  key  :counts, Hash
  key  :tags,   Set
end

Copyright (c) 2011 PeepAll Ltd, released under the MIT license