Module: TaggableModel::TaggableClassMethods

Defined in:
lib/taggable_model.rb

Instance Method Summary collapse

Instance Method Details

#is_taggable?Boolean

Returns:

  • (Boolean)


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

def is_taggable?
  true
end

#tagged_with(somewords = []) ⇒ Object



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

#tags_for_cloud_from(these, limit = 50) ⇒ Object



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