Module: ActsAsTaggableOn::Taggable::TaggedWithQuery

Defined in:
lib/acts-as-taggable-on/taggable/tagged_with_query.rb,
lib/acts-as-taggable-on/taggable/tagged_with_query/query_base.rb,
lib/acts-as-taggable-on/taggable/tagged_with_query/all_tags_query.rb,
lib/acts-as-taggable-on/taggable/tagged_with_query/any_tags_query.rb,
lib/acts-as-taggable-on/taggable/tagged_with_query/exclude_tags_query.rb

Defined Under Namespace

Classes: AllTagsQuery, AnyTagsQuery, ExcludeTagsQuery, QueryBase

Class Method Summary collapse

Class Method Details

.build(taggable_model, tag_model, tagging_model, tag_list, options) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/acts-as-taggable-on/taggable/tagged_with_query.rb', line 11

def self.build(taggable_model, tag_model, tagging_model, tag_list, options)
  if options[:exclude].present?
    ExcludeTagsQuery.new(taggable_model, tag_model, tagging_model, tag_list, options).build
  elsif options[:any].present?
    AnyTagsQuery.new(taggable_model, tag_model, tagging_model, tag_list, options).build
  else
    AllTagsQuery.new(taggable_model, tag_model, tagging_model, tag_list, options).build
  end
end