Module: TaggableModel::TaggableClassMethods

Defined in:
lib/taggable_model.rb

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) is_taggable?

Returns:

  • (Boolean)


75
76
77
# File 'lib/taggable_model.rb', line 75

def is_taggable?
  true
end

- (Object) tagged_with(somewords = [])



67
68
69
70
71
72
73
# File 'lib/taggable_model.rb', line 67

def tagged_with(somewords=[])
  if somewords.is_a?(Array)
    self.from_all_tags(somewords)
  else
    self.from_all_tags( Tag.from_list(somewords) )
  end
end

- (Object) tags_for_cloud_from(these, limit = 50)



79
80
81
# File 'lib/taggable_model.rb', line 79

def tags_for_cloud_from(these, limit=50)
  Tag.attached_to(these).most_popular(limit)   # here popularity is use-count *within the group*
end