Sha256: 88a2ee150b64da4fbe6c00caf7b1d98b2d7800fe83c389338c2b06c6bbc209c8
Contents?: true
Size: 1.06 KB
Versions: 1
Compression:
Stored size: 1.06 KB
Contents
= mongoid-simple-tags {<img src="https://secure.travis-ci.org/chebyte/mongoid-simple-tags.png"/>}[http://travis-ci.org/chebyte/mongoid-simple-tags] mongoid-simple-tags is a basic and simple tagging system for mongoid using map-reduce function (no backwards compatibility with mongoid v2!) == Install Add the following to Gemfile: gem "mongoid-simple-tags", "0.0.7" == Usage === Model class User include Mongoid::Document include Mongoid::Document::Taggable end === Console u = User.create(:name => "Tuquito", tag_list: "linux, tucuman, free software") u.tags # => ["linux","tucuman","free software"] User.tagged_with("linux") # => u User.tagged_with(["tucuman", "free software"]) # => u u2 = User.new(:name => "ubuntu") u2.tag_list = "linux" u2.save User.tagged_with("linux") # => [u, u2] # using map-reduce function User.all_tags #=>[{:name=>"free software", :count=>1}, {:name=>"linux", :count=>2}, {:name=>"tucuman", :count=>1}] == Copyright Copyright (c) 2011 chebyte(mauro torres). See LICENSE.txt for further details.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mongoid-simple-tags-0.0.7 | README.rdoc |