Class: ActsAsTaggable::Tag
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ActsAsTaggable::Tag
- Defined in:
- lib/acts_as_taggable/tag.rb
Instance Method Summary collapse
- #taggable_class ⇒ Object
-
#taggings_cache_key ⇒ Object
Returns a cache key that is unique based on the last time the tags were updated or applied.
- #to_s ⇒ Object
Instance Method Details
#taggable_class ⇒ Object
15 16 17 |
# File 'lib/acts_as_taggable/tag.rb', line 15 def taggable_class self.taggable_type.constantize end |
#taggings_cache_key ⇒ Object
Returns a cache key that is unique based on the last time the tags were updated or applied
20 21 22 |
# File 'lib/acts_as_taggable/tag.rb', line 20 def taggings_cache_key [name, taggings.maximum(:id), taggings.count] end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/acts_as_taggable/tag.rb', line 11 def to_s self.name end |