1 2 3 4 5 6 7 8 9
class Tag def self.unique_tags ActsAsTaggableOn::Tag .joins(:taggings) .where(taggings: { context: 'tags' }) .order(:name) .distinct end end