Module HasMachineTags::Finder

  1. lib/has_machine_tags/finder.rb

Methods

public instance

  1. find_tagged_with

Public instance methods

find_tagged_with (*args)

Takes a string of delimited tags or an array of tags. Note that each tag is interpreted as a possible wildcard machine tag.

Options:

:conditions - A piece of SQL conditions to add to the query.

Example:

Url.tagged_with 'something' # => fetches urls tagged with 'something'
Url.tagged_with 'gem:'      # => fetches urls tagged with tags that have namespace gem
Url.tagged_with 'gem, something' # =>  fetches urls that are tagged with 'something'
  or 'gem'

Note: This method really only needs to be used with Rails < 2.1 .
Rails 2.1 and greater should use tagged_with(), which acts the same but with
the benefits of named_scope.
[show source]
# File lib/has_machine_tags/finder.rb, line 19
    def find_tagged_with(*args)
      options = find_options_for_tagged_with(*args)
      options.blank? ? [] : find(:all,options)
    end