Module: MakeTaggable::Taggable::Collection
- Defined in:
- lib/make_taggable/taggable/collection.rb
Overview
Counting tags, for tag clouds and "most used" lists.
Each context gets <context>_counts and top_<context> on both the class and its instances.
Defined Under Namespace
Modules: CalculationMethods, ClassMethods
Class Method Summary collapse
- .included(base) ⇒ void private
Instance Method Summary collapse
-
#tag_counts_on(context, options = {}) ⇒ ActiveRecord::Relation
Tags used on this record in one context, each carrying how often it was used.
Class Method Details
.included(base) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
16 17 18 19 |
# File 'lib/make_taggable/taggable/collection.rb', line 16 def self.included(base) base.extend MakeTaggable::Taggable::Collection::ClassMethods base.initialize_make_taggable_collection end |
Instance Method Details
#tag_counts_on(context, options = {}) ⇒ ActiveRecord::Relation
Tags used on this record in one context, each carrying how often it was used.
266 267 268 |
# File 'lib/make_taggable/taggable/collection.rb', line 266 def tag_counts_on(context, = {}) self.class.tag_counts_on(context, .merge(id: id)) end |