module Alchemy::Taggable::ClassMethods

Public Instance Methods

tag_counts() click to toggle source

Returns all unique tags

# File lib/alchemy/taggable.rb, line 43
def tag_counts
  Gutentag::Tag.distinct.joins(:taggings)
    .where(gutentag_taggings: {taggable_type: name})
end
tagged_with(names = [], **args) click to toggle source
Calls superclass method
# File lib/alchemy/taggable.rb, line 26
def tagged_with(names = [], **args)
  if names.is_a? String
    names = names.split(/,\s*/)
  end

  unless args[:match]
    args[:match] = :all
  end

  if names.any?
    args[:names] = names
  end

  super(args)
end