acts_as_taggable_on: Match records tagged with all, any or none of the given tags

Posted Over 12 years ago. Visible to the public.

The tagged_with Show archive.org snapshot scope comes with many awesome options to modify your search:

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", :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'
Henning Koch
Last edit
About 12 years ago
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2012-01-04 10:11)