No commit activity in last 3 years
No release in over 3 years
Mongoid Taggable provides some helpers to create taggable documents, can use many fields.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 4.0.0
 Project Readme

Mongoid Taggable On

Mongoid Taggable provides some helpers to create taggable documents, can use many fields.

Status

CI Status Gem Version

Installation

You can simple install from rubygems:

gem install mongoid_taggable_on

or in Gemfile:

gem "mongoid_taggable_on"

Usage

class Movie
  include Mongoid::Document
  include Mongoid::TaggableOn

  taggable_on :actors, index: false
  taggable_on :directors
  taggable_on :countries

  field :title
  field :summary
end

Now you can use sample:

irb> movie = Movie.new
irb> movie.actor_list = "Jason Statham, Joseph Gordon-Levitt, Johnny Depp, Nicolas Cage"
irb> movie.actors
["Jason Statham", "Joseph Gordon-Levitt", "Johnny De", "Nicolas Cage"]

irb> movie.country_list = "United States| China|Mexico"
irb> movie.countries
["United States", "China","Mexico"]

find with tag:

irb> Movie.tagged_with_on(:actors, "Jason Statham, Joseph Gordon-Levitt")
irb> Movie.tagged_with_on(:actors, "Jason Statham, Joseph Gordon-Levitt", match: :any)
irb> Movie.tagged_with_on(:actors, "Nicolas Cage", match: :not)

Allow split chars

, ,| /

Who used that?

In 720p.so, the Movie actors, directors, languages, countries, tags all base in mongoid_taggable_on.