acts-as-taggable-on

https://github.com/mbleigh/acts-as-taggable-on

Ruby

A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.

ActsAsTaggableOn::Taggable::Core::ClassMethods#tagged_with

Return a scope of objects that are tagged with the specified tags.

Example:
  User.tagged_with(["awesome", "cool"])                     # Users that are tagged with awesome and cool
  User.tagged_with(["awesome", "cool"], :exclude => true)   # Users that are not tagged with awesome or cool
  User.tagged_with(["awesome", "cool"], :any => true)       # Users that are tagged with awesome or cool
  User.tagged_with(["awesome", "cool"], :any => true, :order_by_matching_tag_count => true)  # Sort by users who match the most tags, descending
  User.tagged_with(["awesome", "cool"], :match_all => true) # Users that are tagged with just awesome and cool
  User.tagged_with(["awesome", "cool"], :owned_by => foo ) # Users that are tagged with just awesome and cool by 'foo'
  User.tagged_with(["awesome", "cool"], :owned_by => foo, :start_at => Date.today ) # Users that are tagged with just awesome, cool by 'foo' and starting today

Source | Google | Stack overflow

Edit

git clone [email protected]:mbleigh/acts-as-taggable-on.git

cd acts-as-taggable-on

open lib/acts_as_taggable_on/taggable/core.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-ActsAsTaggableOn--Taggable--Core--ClassMethods-tagged_with-for-pr


# Commit to git

git add lib/acts_as_taggable_on/taggable/core.rbgit commit -m "better docs for ActsAsTaggableOn::Taggable::Core::ClassMethods#tagged_with"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-ActsAsTaggableOn--Taggable--Core--ClassMethods-tagged_with-for-pr

hub pull-request


# Celebrate!